Hi,
I would like to do the equivalent of this in XAML:
XamDPCashflowModels.FieldLayouts[0].Fields[
"LoanName"].Visibility = Visibility.Collapsed;
I have created a Style in XAML
<
Style x:Key="collapsedFieldStyle" TargetType="igDP:LabelPresenter"> <Setter Property="Visibility" Value="Collapsed"/></Style>
igDP:XamDataGrid.FieldLayouts><igDP:FieldLayout><igDP:Field Name="LoanName" Label="LoanName"><igDP:Field.Settings><igDP:FieldSettings LabelPresenterStyle="{StaticResource collapsedFieldStyle}"/></igDP:Field.Settings></igDP:Field></igDP:FieldLayout></igDP:XamDataGrid.FieldLayouts>
However it doesnt work. What am I doing wrong?
Many Thanks
In fact it is set to true. However I am still able to hide the label of the field called "IsVirtual" despite the fact that it is auto generated. Why cant I collapse a field (like "IsInDesignMode") in the same fashion?
Style x:Key="hiddenFieldStyle" TargetType="igDP:LabelPresenter"><Setter Property="Visibility" Value="Hidden"/></Style>
igDP:XamDataGrid.FieldLayouts><igDP:FieldLayout><igDP:FieldLayout.Fields><igDP:Field Name="IsVirtual"><igDP:Field.Settings><igDP:FieldSettings CellValuePresenterStyle="{StaticResource iconFieldCell}" LabelPresenterStyle="{StaticResource hiddenFieldStyle}"/></igDP:Field.Settings></igDP:Field><igDP:Field Name="IsInDesignMode" Label="IsInDesignMode" Visibility="Collapsed"/></igDP:FieldLayout.Fields></igDP:FieldLayout></igDP:XamDataGrid.FieldLayouts>
Could you check the AutoGenerateFields property in the FieldLayoutSettings? It should be set to false when defining the Fields manually.
<igDP:XamDataGrid.FieldLayoutSettings>
<igDP:FieldLayoutSettings AutoGenerateFields="False"/>
</igDP:XamDataGrid.FieldLayoutSettings>
Not sure why, but it doesnt seem to work :(
I have this
igDP:Field Name="IsInDesignMode" Label="IsInDesignMode" Visibility="Collapsed"/>
within the DataGrid's
igDP:XamDataGrid.FieldLayouts><igDP:FieldLayout><igDP:FieldLayout.Fields>
with no luck
Many Thanks!
You can set the Visibility directly on the Field like that:
<igDP:Field Name="LoanName" Label="LoanName" Visibility="Collapsed">
Hope this helps!