Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
550
Multiple Fixed colums which cannot be moved
posted

Hi,

i have a requirement where i need to fix 2-3 colums to the left of my grid and i dont want user to drag drop them. i am using the following code but it does not seem to work. please help.

 

 

 

 

 

 

 

Column DisplayAsFixedColumn = this.dataGrid.Columns.DataColumns["TradeId"

];

 

 

 

this

.dataGrid.FixedColumnSettings.FixedColumnsLeft.Add(DisplayAsFixedColumn);

 

 

 

Column DisplayAsFixedColumn1 = this.dataGrid.Columns.DataColumns["TradeDate"

];

 

 

 

this

.dataGrid.FixedColumnSettings.FixedColumnsLeft.Add(DisplayAsFixedColumn1);

  • 6912
    Suggested Answer
    posted

    Hi,

    You can fix a column and set IsFixable=false and IsMovable=false to prevent the end user from unpinning and moving the columns.

    For example:

    Column dataColumn = this.XGrid.Columns.DataColumns["MyColumnKey"];
    dataColumn.IsFixed = FixedState.Left;
    dataColumn.IsFixable = false;
    dataColumn.IsMovable = false;

    HTH