GridTreeControl: Freeze a column

Can I freeze columns (to the left or right), just like how the first column in the tree is frozen in the left by default..


1 Reply

CB Clay Burch Syncfusion Team February 8, 2012 03:41 PM UTC

You can freeze columns on the left and right in a GridTreeControl by accessing properties in the gridTreeControl.Model object. Here are some code snippets.

public MainWindow()
{
employees.PopulateWithSampleData(500);

InitializeComponent();

this.gridTreeControl1.ModelLoaded += (s, e) =>
{
//set up frozen columns on the left
// value of 1 is rowheader (may be hidden)
// value of 2 is expand col (default setting)
//value of 3 will freeze first col to right of expander column
this.gridTreeControl1.Model.FrozenColumns = 3;


//set up frozen columns on the right
this.gridTreeControl1.Model.FooterColumns = 1; //freezes one column on right
};
}



Attached is a sample.



GTC_FreezeColumns_46fb4bc1.zip

Loader.
Up arrow icon