I am trying to define the layout of my XamDataGrid through xaml Styles (so that the actual layout can be controlled by interchangeable Resource Dictionaries.) The igDP:XamDataGrid.FieldLayouts tag has a Style property, but when I try to define a Setter for FieldLayout, I get the error "The property FieldLayout does not exist in the http://infragistics.com/DataPresenter namespace".
I've searched the help, forum and web for an example or solution to set this (or another way to setup the layout of the XamDataGrid in a Resource Dictionary) and have found nothing. Any ideas?
Thanks in advance for your help.
Unfortunately, after much testing (and gnashing of teeth) it has become obvious that the XamDataGrid.AssigningFieldLayoutToItem event still requires all FieldLayouts (and associated FieldLayoutSettings) to be defined within the <XamDataGrid></XamDataGrid> tags on the GUI page itself. The AssigningFieldLayoutToItem refers to a "Key" field, but that's internal to the FieldLayouts collection, not an x:Key reference that I can assign in an outside assembly - which is my ultimate objective.
Any other ideas, or is this just a "no can do" for now.
AYS,
Jeff
Thanks sebl. I was just returning to the forum to post AssigningFieldLayoutToItem as a possible solution. I just found an example of that method in the online help [Manually Assigning a Field Layout to xamDataGrid]. It looks promising.
Thank you for the reply.
J
You could add all the possible field layouts in xaml and handle AssigningFieldLayoutToItem to use the correct layout based on the context
Ok... if "Xaml Styling" is not an option, what is the recommended methodology to (re)configure field layout, header info and properties at runtime? Is there one?
Thanks in advance.
Jeff,
You can define something like this:
<Style TargetType="{x:Type igDP:XamDataGrid}">
<Setter Property="FieldLayoutSettings">
<Setter.Value>
<igDP:FieldLayoutSettings AllowFieldMoving="No"/>
</Setter.Value>
</Setter>
</Style>
but you cannot the same for the FieldLayouts collection.