Grid column content is shifted when a previous column's content is too large for that column #17529
Unanswered
AngryCarrot789
asked this question in
Q&A
Replies: 2 comments
-
Is there a reason you can't just use TreeDataGrid? https://docs.avaloniaui.net/docs/controls/treedatagrid/creating-a-hierarchical-treedatagrid Do note that TreeDataGrid is going to be deprecated late next year unless you pay for it. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I don't use data binding/data templates in my apps and AFAIK you need to use it for the TreeDataGrid. And if I need to pay for it soon then that also |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I made a few custom controls (TreeViewItem etc.) that mimic a data grid styled tree view. I define a set of GridLength properties in a control whose template contains the TreeView and then I bind to them in each TreeViewItem.
I noticed that Avalonia uses a converter in the TreeViewItem's template for the header parts which is a nice touch, however, I think it's what is causing my issue but I also don't want to remove it since having the selection border span the entire length looks better
Here is a permalink to my tree view item template: https://github.com/AngryCarrot789/PicNetStudio/blob/master/PicNetStudio.Avalonia/PicNet/Layers/Controls/LayerControlStyles.axaml#L11
This is what it is supposed to look like normally:
But if I then resize the Name column such that it's too small to fit the header content, the 2nd column (technically 3rd since I use a 0 width spacer) refuses to clip the 1st column's content, and so it stays in place
Could anyone help me figure out how to force the Name column to get clipped, so that the State column's contents overlap it rather than get fixed in place like it does in the 2nd image?
Beta Was this translation helpful? Give feedback.
All reactions