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>
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.
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>
Hello,
I am just checking the progress of this issue. Let me know if you need any further assistance.
Hello again,
Now I see what you want. Because it’s a little tricky I created a sample project for you. Basically I create an instance of FieldSettings in the Grid’s Resources, set some properties and use that instance on every Field I want to apply these settings by set their Settings property to it. Please let me know if this is what you are trying to achieve or I have misunderstood you in some way.
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