Example #1
0
 /// <summary> Add a Column (at the end) to the grid </summary>
 public void AddColumn(GLDataGridViewColumn col)
 {
     System.Diagnostics.Debug.Assert(col.Parent == this && col.HeaderStyle.Parent != null);      // ensure created by us
     col.HeaderStyle.Changed += (e1) => { colheaderpanel.Invalidate(); };
     col.Changed             += (e1, ci) =>
     {
         if (ci)                   // if set, it means width has changed in some way
         {
             autosizegeneration++; // force autosize as we changed width
             ContentInvalidateLayout();
         }
         else
         {
             colheaderpanel.Invalidate();
         }
     };
     col.SetColNo(columns.Count);
     columns.Add(col);
     autosizegeneration++;           // force autosize as we changed columns
     ContentInvalidateLayout();
 }