I have several fieldlayouts each which share some common fields, is there away i declare a fieldsettings once and resuse it with any field wherever I want?
For example I have a common field settings that specify the CellMinWidthand CellMaxWidth for a field, currently I have to declare this in every common filed of every layout.
<igDP:Field.Settings> <igDP:FieldSettings AllowEdit="False" CellMinWidth="150" CellMaxWidth="150" CellClickAction="SelectRecord"/> </igDP:Field.Settings>
Hello,
Thank you for your post. I have been looking through it and I suggest you put the following code in your XamDataGrid:
<igDP:XamDataGrid.FieldSettings> <igDP:FieldSettings CellMinWidth="100" CellMaxWidth="150" AllowEdit="False"/> </igDP:XamDataGrid.FieldSettings>
to achieve your goal. Please let me know if this helps you or you need further clarifications on this matter.
Looking forward for your reply.
Nope, because the thats going to set all fields to that. If I have two or more common fields that each have different widths then this achieves nothing,
I actually have 14 field layouts in my case
Each layout has radically different fields including the number of the fields but say they all share three or four common fields but each common filed is itself different than the others but all fields of the same type must look the same, currently I have to declare this field settings in each layout by copying and pasting but its annoying If i have to change it again. Is there no way to share a field settings among the layouts by declaring it as a resource ? Styles would be perfect here but there is no style for a fieldsetting
I am just checking the progress of this issue. Let me know if you need any further assistance.
I tried this yesterday and it worked, great, funny thing is I tried to do this before and it wouldnt compile, so I must have done something wrong. btw the example is not so tricky that is could not be posted here for posterity, there was no need for a solution so I post the answer now.
<Grid> <Grid.Resources> <igDP:FieldSettings x:Key="FS" AllowEdit="False" CellMinWidth="100" CellMaxWidth="150"/> </Grid.Resources> <igDP:XamDataGrid Name="xamDataGrid1" BindToSampleData="True" VerticalAlignment="Top" > <igDP:XamDataGrid.FieldLayouts> <igDP:FieldLayout> <igDP:Field Name="name" Settings="{StaticResource FS}"/> </igDP:FieldLayout> </igDP:XamDataGrid.FieldLayouts> </igDP:XamDataGrid> </Grid>
Hi again,
Thank you for your feedback. I am glad that I helped you resolve your issue and I believe that other community may benefit from this answer as well.
Thanks again.