Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
15
How to set column width auto-sizing when DataOrientation is horizontal?
posted

Hi,

To show records in horizontal, i set the Orientation property off the GridViewSettings .And i also need to adjust the size of all cells' width to fit within its boundaries. But use by setting a FieldLayoutSettings object’s AutoFitMode property  , autosizing the Height when the Orientation is Horizontal. Could anyone please help? Thanks.

Parents
No Data
Reply
  • 1700
    Verified Answer
    Offline posted

    Hello Jing,

    The AutoFitMode property, is used to define whether fields are resized to always fill the available area of the XamDataGrid and since the orientation of the gird is set to Horizontal, the AutoFitMode would be applied on the height of the grid, extending the fields to fit in the total height of the grid. This is because only autosizing of the logical column extent is supported. For example, the Width when the Orientation is Vertical and the Height when the Orientation is Horizontal.

    The width of the fields could still be modified from FieldSetting with the following properties - CellWidth, CellMaxWidth and CellMinWidth.

    Moreover, a text wrapping could be applied to fit the cells content to the width of the field. Since the gird has Horizontal orientation the height property needs to be modified with a value that would fit the contents of the cell. This could be achieved by styling the XamTextEditor like this:

    <igWPF:XamDataGrid.Resources>

                    <Style TargetType="{x:Type igEditors:XamTextEditor}">

                        <Setter Property="TextWrapping" Value="Wrap"/>

                        <Setter Property="Height" Value="40"/>

                    </Style>

    </igWPF:XamDataGrid.Resources>

    Please let me know if you have any questions.

    Regards,
    Ivan Kitanov

Children