Hi,
when i try to add a group programmatically, I get the error - 'Group can't be null'
what could be the reason for this? Here's how i add grouping:
if (dgMain.GroupColumnDescriptions.Count != 0) { dgMain.GroupColumnDescriptions.Clear(); }
dgMain.View.BeginInit();
string[] GCols = gl.GroupByCols.Split(',');
foreach (string s in GCols)
{
dgMain.Columns.Add(Cols.Find(x => x.MappingName.Contains(s)));
GroupColumnDescription gp = new GroupColumnDescription();
gp.ColumnName = s;
this.dgMain.GroupColumnDescriptions.Add(gp);
}
dgMain.View.EndInit();