문제

I'm writing Silverlight application and I have a datagrid in which first two columns' positions are fixed, but others can be reordered. If I simply set CanUserReorder property to true/false respectively, than I can still take 3rd column and put it into 1st position.

What can I do to implement behaviour I need?

For now I can only think of manually handling ColumnReordered/ColumnReordering events in code-behind. Are there any solutions I am missing?

도움이 되었습니까?

해결책

Check out the FrozenColumnCount of the datagrid.

dgMyGrid.FrozenColumnCount = 2

That will prevent the first two columns from being moved. As a "bonus", they won't scroll while others do (though this may not be what you want...)

From MSDN Blog: http://blogs.msdn.com/b/scmorris/archive/2008/10/15/freezing-columns-in-the-silverlight-datagrid.aspx

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top