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

Column Freezing

Hi,

We are using gridgroupping control. i want achive column freezing following condition.


If a column that is currently ‘frozen’ is dragged to the right of a columns is not frozen, then the column that is being dragged will no longer be frozen. If a column that is currently not frozen is dragged to the left of a column that is frozen, then that column should become frozen.


Please resolve the problem asap.


Regards
Tannearu Hazarathaiah

2 Replies

AD Administrator Syncfusion Team December 1, 2006 09:39 AM UTC

Hi Tannearu,

You can handle the TableControl.QueryAllowDragColumnHeader event and change the frozen column count. Here is a code snippet to show this.

private void TableControl_QueryAllowDragColumn(object sender, GridQueryAllowDragColumnEventArgs e)
{
if( e.Reason.ToString() == "MouseUp")
{
int fColCount = e.TableControl.Model.Cols.FrozenCount;
int row,col;
e.TableControl.TableDescriptor.ColumnToRowColIndex(e.Column,out row,out col);
int irow,icol;
e.TableControl.TableDescriptor.ColumnToRowColIndex(e.InsertBeforeColumn,out irow,out icol);
if( !(col <= fColCount && icol <= fColCount ) )
{
e.TableControl.Model.Cols.FrozenCount = icol;
}
}
}

Here is a sample.
GGCDragFrozenColumnHeader.zip

Best Regards,
Haneef


TH Tannearu Hazarathaiah Gupta December 1, 2006 12:28 PM UTC

Hi haneef,
Its working.

Regards
Tannearu

Loader.
Live Chat Icon For mobile
Up arrow icon