Hello,
I have a xamdatagrid in Horizontal Orientation with the DataRecordSizingMode set to "SizedToContentAndIndividuallySizable". Now, when I change the size (width or height) of the record, and then change orientation to vertical, the field widths and record widths do not line up with each other. I have attached an image that should hopefully better describe the situation I am seeing.
How can I enable the user to individually size each record in a certain orientation, but not have the new sizings carry over when orientation is switched??
Thanks,
Chris
Hi Chris,
I am just checking if my last reply was helpful for you.
If you require any further assistance on the issue regarding the orientation of the grid, please do not hesitate to ask.
Hello Chris,
I have been looking into your post and I understand what you are trying to achieve. When the DataRecordSizingMode is set to "SizedToContentAndIndividuallySizable" the individual widths of the records are saved and the user can easily change them. If the orientation of the grid is changed to vertical, this property is not changed and different widths are displayed. To prevent this from happening you could change the DataRecordSizingMode property when switching to vertical orientation:
private void Button_Click_1(object sender, RoutedEventArgs e)
{
if (grid1.ViewSettings.Orientation == Orientation.Horizontal)
grid1.ViewSettings.Orientation = Orientation.Vertical;
grid1.FieldLayoutSettings.DataRecordSizingMode = DataRecordSizingMode.Default;
}
else
grid1.ViewSettings.Orientation = Orientation.Horizontal;
grid1.FieldLayoutSettings.DataRecordSizingMode = DataRecordSizingMode.SizedToContentAndIndividuallySizable;
Please feel free to let me know if you have any other questions.