Hello,
i have a xamdatagrid with recordorientation set to horicontal. In this case the first column will display the labels of the fields. I am allfready using a LabelPresenter but with or without the label presenter i have the problem that the names in the first column are not completely visible. I found i can set the width of the first column with FieldSettings.LabelWidth but maybe there's more:
Q1: (How) can i auto adjust the size of the first column depending om the displayed content? (maybe I'm missing something like FieldSettings.HoricontalLabelContentAllignment=Stretch)
Q2: (How) can i let the user resize the first column? (i think FieldSettings.AllowResize should also allow horicontal resize. currently there seems only vertical resize to be implemented)
Thanks and regards,
kmb
Hello KarlMichael,
Thank you for your post. I have been looking into it and have created a small sample for you, named HorizontalXamDataGrid. In it I set a style for the HeaderPresenter and change the width of the label column from there.
For your second requirement I can suggest to set the DataRecordSizingMode to IndividuallySizable. This way you would be able to resize your record both ways – horizontally and vertically. You can see this behavior implemented in the sample.
Please refer to the attached sample and feel free to let me know if you have any further questions on the mater.
ok your answer is close but not exactly what i requested.
1. I know how i can set the width of the column now but i still lack of a solution to auto size the column. DataRecordSizingMode="SizedToContent seems not to affect the width of the first column.
2. Same to the user-resizing. DataRecordSizingMode="IndiviuallySizeable" allows to change the height of the column but the width is not changeable.
Maybe we have a version problem? i'm currently still using wpf4.12.1
Kind regards,