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
94
FieldLayout - ResourceDictionary
posted

Hi,

is it possible to define a FieldLayout in a ResourceDictionary (own XAML and directory) ?

FieldSetting and FieldLayoutSettings work well.

 

Resourcedictionary.xaml

<igDP:FieldSettings x:Key="Settings1"
                                     AllowEdit="False"
                                     AllowGroupBy="False"
                                     AllowRecordFiltering="True"
                                     CellClickAction="EnterEditModeIfAllowed" />


    <igDP:FieldLayoutSettings  x:Key="Settings2"
                                                      AllowAddNew="False"
                                                      AllowDelete="False"
                                                      AllowRecordFixing="Top"
                                                      AutoFitMode="Always"
                                                      HighlightAlternateRecords="True" />

 

MainWindow.xaml

<igDP:XamDataGrid x:Name="xamDataGrid" FieldLayoutSettings="{DynamicResource Settings2}" FieldSettings="{DynamicResource Settings1}" />

 

But how i will get a FieldLayout to work like this:

    <igDP:FieldLayout  x:Key="FieldLayout1">
        <igDP:FieldLayout.Fields>
            <igDP:Field Name="name" />
            <igDP:Field Name="department" />
            <igDP:Field Name="salary" />
            <igDP:Field Name="email" />
        </igDP:FieldLayout.Fields>
    </igDP:FieldLayout>

Thanks in advanced.

 

Edit. DataSource is bind programmaticly on ClickEvent in Code behind (VB.net)

Parents
  • 69686
    posted

    Hello,

    I was not able to understand the second part of your question. Yes, you can define a layout in a resource dictionary or in any resources as long as you set the x:Key property.

    >"But how i will get a FieldLayout to work like this:"

    You cannot define a FieldLayout unless you know what the DataSource looks like. If you do not know the DataSource, the FieldLayout has to be defined in runtime, because you do not know the names of the fields.

Reply Children