Example #1
0
 protected virtual void OnMeasureSubItem(MeasureSubItemEventArgs e)
 {
     if (MeasureSubItem != null && MeasureSubItem.GetInvocationList() != null)
     {
         MeasureSubItem.DynamicInvoke(new object[] { this, e });
     }
 }
Example #2
0
 protected override void OnMeasureItem(MeasureItemEventArgs e)
 {
     base.OnMeasureItem(e);
     if (!this.DesignMode)
     {
         int maxSubItemHeight             = 0;
         PropertyDescriptorCollection pdc = this.DataManager.GetItemProperties();
         for (int currentColumnIndex = 0; currentColumnIndex < realColumnCount; currentColumnIndex++)
         {
             e.ItemWidth = ColumnWidths[currentColumnIndex];
             MeasureSubItemEventArgs msiea = new MeasureSubItemEventArgs(e.Graphics, e.Index, currentColumnIndex);
             OnMeasureSubItem(msiea);
             if (msiea.ItemHeight > maxSubItemHeight)
             {
                 maxSubItemHeight = msiea.ItemHeight;
             }
         }
         e.ItemHeight = maxSubItemHeight;
     }
 }