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
20
XamDataGrid disable columns AutoFit
posted

Hello

How to disable columns AutoFit?

Many thanks

  • 34810
    Offline posted

    Hello Zed Zed,

    I apologize for the delay in response to this thread.

    In order to prevent the column auto-fit, you can set the DefaultColumnWidth and/or DefaultColumnMinWidth properties of the XamDataGrid. At the time of writing this, the DefaultColumnWidth takes a ColumnWidth object, and so to set this, you can use the following XAML:

    <ig:XamDataGrid ItemsSource="{Binding Data}">
       <ig:XamDataGrid.DefaultColumnWidth>
          <ig:ColumnWidth Value="200" />
        </ig:XamDataGrid.DefaultColumnWidth>
    </ig:XamDataGrid>

    Please note that you can also set the Width properties of the columns that you define if you are manually generating them.

    Please let me know if you have any other questions or concerns on this matter.