Is it possible to pin columns of a Silverlight DataGrid? RRS feed

  • General discussion

  • Hi,

    All I want to do is pin the first column of a DataGrid and also pin the last column of a DataGrid.

    The user cannot re-order the first column nor the last column, but can reorder any of the "middle" columns.

    I am not sure how to prevent the user from dragging a column *before* the first pinned column, or dragging a column *after* the last pinned column.

    Essentially, I want to make sure that the DisplayIndex of the first/last column will not change!, but for other columns it can certainly change.

    Is this possible to do?

    Thursday, December 15, 2011 3:56 PM

All replies

  • You can use the ColumnReordering event of the datagrid and there cancel reordering if the columns of your choice.

    Just set the Cancel property of the DataGridColumnReorderingEventArgs to true.

    Friday, December 16, 2011 2:17 AM