I have a xamDataGrid bound to a custom data source with 50 data attributes. Simply put:
Example: Selection Attribute = 1; display columns A, B, and C. Selection Attribute = 2; display columns A, D, and E. Selection Attribute = 3; display columns F, G, and H.
Has anyone solved a similar problem?
Graham
Graham,
So, in that case is it possible to create the layout when the quiry is completed in runtime?
My colleague Vladimir Zagorski has answered a forum post about changing layouts in runtime. When the quiry is completed, you can build the layout according to the Attribute.
http://community.infragistics.com/forums/p/22589/83349.aspx#83349
Let me know if that post is helpful and useful in your case?
Alex.
Alex,
That might be a better idea with the FieldLayouts. The problem you mentioned does not exist in my design as the defining attribute is set only once for the query. Once the records are returned I must only select the FieldLayout that is associated with the value in the defining attribute. I suppose I must resort the code here, or is there a way to bind the required FieldLayout to the value of my defining attribute? Moreover, do you have a code snippet or article that expands on your option?
Regards
Another option to do this is to define FieldLayouts. Each FieldLayout would consist of particular fields (e.g. 2,8,10,16) and you can change the field layouts depending on which layout you want.
Downside of this approach is that you have to rebind each time you switch field layouts.
Hi Alex,
This has already been done. If a column in the xamDataGrid has a "Visiblity" property then I could do something like:
Visiblity = "{Binding Path=IsField16Visible, Converter={StaticResource BooleanToVisibilityConverter}}"
I suppose.
Hello Graham,
As far as I was able to get an idea of what your datasource looks like, this is not supported. Your best option is to convert your datasource/data attributes to new DataSource of type BindingList<T> with underlying classes and then bind it to the XamDataGrid.
Regards,