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.
EDIT: To clarify, it will still need to be the first column that is frozen, but it'll be frozen to the right side. Sorry, something went wrong. Sorry, something went wrong. I tried this alternative solution you have mentioned @miloush . Last column can be freezed.But then so many other issues are rising compared to normal WPF data-grid behavior.
Set the Datagrid's FrozenColumnCount = "1". Frozen columns are columns that are always displayed and cannot be scrolled out of visibility. Frozen columns are always the leftmost columns in display order. You cannot drag frozen columns into the group of unfrozen columns or drag unfrozen columns into the group of frozen columns.
You can freeze columns programmatically using the LeftFrozenColumnCount and RightFrozenColumnCount properties of RadGridView control. They are both numeric and you have to set them to the number of columns you wish to freeze. In Example 1, the first two columns are frozen starting from left to right.
To freeze a column on the left, the user has to drag the left frozen columns separator. Once there is a frozen column, you can freeze other columns by dragging their headers behind the frozen columns separator.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With