Is there a way to set the AllowDelete on a child, but not for the parent?
chr15t1an
Of course! Can't believe I overlooked that one.
Hello,
If you define the field layouts in xaml like this:
<igDP:FieldLayout > <igDP:FieldLayout.Settings> <igDP:FieldLayoutSettings AllowDelete="False"/> </igDP:FieldLayout.Settings> <igDP:FieldLayout.Fields > <igDP:Field /> <igDP:Field /> <igDP:Field /> </igDP:FieldLayout.Fields> </igDP:FieldLayout> <igDP:FieldLayout> <igDP:FieldLayout.Settings> <igDP:FieldLayoutSettings AllowDelete="True"/> </igDP:FieldLayout.Settings> <igDP:FieldLayout.Fields> <igDP:Field /> <igDP:Field /> </igDP:FieldLayout.Fields> </igDP:FieldLayout>
Alex.
I literally just figured this out before getting an update to my post. Is there a cleaner way to do it thru Xaml?
You can do the following:
xamDataGrid1.FieldLayouts[0].Settings.AllowDelete = false;xamDataGrid1.FieldLayouts[1].Settings.AllowDelete = true;
Note: If you have not defined the FieldLayout[1] in the xaml you have to expand it(the Child records). Otherwise the field layout will not have been created and an exception will be thrown.