Freezing columns in wpf datagrid

…衆ロ難τιáo~ 提交于 2019-12-23 06:49:31

问题


I have some tabular data which has a lot of fields in it, and when my WPF application is resized a lot of them are cut off. However, I want to see the first 6 columns always as they are important. How can I achieve this in a grid format? I am using the WPFToolkit DataGrid but can be persuaded to change to a different control if one exists.

Right now, I am using two different DataGrids side by side with the right most datagrid inside a scrollviewer with horizontal scrolling on and the vertical scrolling off. I will also have to either sync the two for sorting purposes or disable sorting altogether.


回答1:


Okay, it's trivial in that control, all you have to do is set FrozenColumnCount = "6", in my case. Maybe someone else will need this and they can laugh at my stupidity.



来源:https://stackoverflow.com/questions/1881961/freezing-columns-in-wpf-datagrid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!