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
3220
xamDataGrid: Binding field width
posted

Hello,

how can I bind the field width? It seems binding is not working.

<ig:Field Name="Message" Label="Message" Width="{Binding MyWidth}" CellValuePresenterStyle='{StaticResource styleMutltilineCell}'/>

  • 35130
    Verified Answer
    posted

    Hello Markus,

    Fields in the XamDataGrid are not visual elements in WPF, and as such cannot be bound directly to a data context, as they do not expose one inherited from FrameworkElement.

    In order to bind the properties of the non-visual elements of the XamDataGrid such as Field, FieldSettings, or FieldLayoutSettings, I would recommend using a FieldBinding. You can read about FieldBinding in the XamDataGrid here: https://www.infragistics.com/help/wpf/xamdatagrid-binding-field-fieldlayout-to-mvvm.

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