We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Allowing frozen column to be grouped but not moved - how to let a Detail do the same thing

Hello,

I have this method which allows a frozen column to be grouped and it also prevents it from being to a different column location:

public void AllowFrozenColumnsToBeGrouped(string FrozenColumnName, int numberAddedColumns)
{
FrozenColumnGroupingName = FrozenColumnName;
FrozenColumnsCanBeGrouped = true;
int field = this.TableDescriptor.NameToField(FrozenColumnName);
//field = this.TableDescriptor.FieldToColIndex(field); // if syncfusion fixes the problem use this line of code and erase the one below this line
field = this.TableDescriptor.FieldToColIndex(field) - numberAddedColumns; // the - here manually fixes a syncfusion bug
this.TableModel.Cols.FreezeRange(1, field);
this.PropertyChanged +=
new Syncfusion.Grouping.DescriptorPropertyChangedEventHandler(grd_PropertyChanged);
this.TableControlQueryAllowDragColumn +=
new Syncfusion.Windows.Forms.Grid.Grouping.GridQueryAllowDragColumnEventHandler(grd_TableControlQueryAllowDragColumn);
}


This works great. But now I am wondering could I do the same thing for Detail tables? If so how could I do this?

Also there might be a bug with the Grid. If you manually move a column around in code and then run this method this line of code returns the wrong column number:
field = this.TableDescriptor.FieldToColIndex(field);




1 Reply

DM David Mecteaux October 20, 2010 07:34 PM UTC

FYI...I needed to turn this into a incident. It is incident: 73399


Loader.
Live Chat Icon For mobile
Up arrow icon