Hi David,
With the FrozenColumn setting in GridGroupingControl, grouping by that frozen column cannot be achieved. However this can be achieved by handling FreezeRange() method call. Here is the code for your reference.
field = this.gridGroupingControl1.TableDescriptor.NameToField("SNo");
col = this.gridGroupingControl1.TableDescriptor.FieldToColIndex(field);
this.gridGroupingControl1.TableModel.Cols.FreezeRange(col,col+2);
With this code, you can set the column with name "SNo" and two subsequent columns as frozen columns.
While handling the grouping, the column index get changed based on the groupedcolumns count. Hence to retain these columns as frozen, the PropertyChanged event can be handled while grouping occurs and the freeze range can be retained accordingly with the following code in it.
if (e.PropertyName == "TableDescriptor")
{
Syncfusion.Grouping.DescriptorPropertyChangedEventArgs prop = e.Inner as Syncfusion.Grouping.DescriptorPropertyChangedEventArgs;
if (prop.PropertyName == "GroupedColumns")
{
this.gridGroupingControl1.TableModel.Cols.RestoreFrozen();
field = this.gridGroupingControl1.TableDescriptor.NameToField('SNo');
col = this.gridGroupingControl1.TableDescriptor.FieldToColIndex(field);
this.gridGroupingControl1.TableModel.Cols.FreezeRange(1, col+2);
}
}
Please refer to the sample in the following link in which this has been implemented.
http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=I717961512226581.zipRegards,
Jisha