Hi,
i have a hierarchical data with DATA Table at model along With Some other properties like 5 -6 ( in future there might be some more) , I Want a Field Layout where i can specify few field on GUI along with Data Table info ( i don't know the Columns of data table as it is dynamic , i just want to display It)
I don't want to change the XAMl all the time (to hide the Field whenever i introduce new one in Model ) as i am only interested in One Field & Complete data Table which it contains.
Sample code Pasted Below to show the model below :
Class SampleViewModel
{
private IEnumerable<InfoModel> Informations{get;set;} // This is the data source for XAMData grid
}
Class InfoModel{
//All properties here
String StudentNAME, ( Need to be shown)
Datatable/DataView BooksIssued; ( Need to be shown, I don't know the Column as its dynamic)
//Some more additonal fields which i dont want on GUI
int ID (Should not be displayed on GUI)
int Age(Should not be displayed on GUI)
Can some body help me writing Field Layout for this scenario as Autogeneration = true results in all Properties along with table on the GUI
Hello,
Thank you for your post. I have been looking into it and I can suggest you see this blog:
http://ko.infragistics.com/community/blogs/petar_monov/archive/2011/05/13/how-to-define-fieldlayouts-how-fieldlyouts-are-mapped.aspx
which describes how to define your field layouts. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
[Stefan]
I have used Auto Generated field but as u can see in the question itself i need Autogeneration for Data Table property only but For rest of the properties int then BO, i want to take the control, i don't know how to do that.
SO as mention
VM has
Top level properties ( i want Auto Generation off for that)
But as its hierarchical , i want auto generation true for one level below
like Data view Details
Hello shahanshah,
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
[Thanks Andrew] This is exactly wat i needed..
I was using Separate Layouts for different fields because of that it was not behaving correctly..
If I understand you correctly and you want to control which properties from the InfoModel class are displayed as Fields/Columns in the grid but have the grid automatically create a Field for each property in the BooksIssued then you would do this by defining the FieldLayout for InfoModel as Stefan mentioned but set the AutoGenerateFields of its Settings object to false so that any additional fields for that FieldLayout would not be generated. I've attached a sample of what I mean.
The thing you can do is set the AutoGenerateFields Property to true and define the parent FieldLayout. This way the child layout will be autogenerated and you still will be able to determine which of the parent FieldLayout's Fields to show by setting their Visibility Properties to Visible or Collapsed. Please let me know if this helps you or you need further assistance on this matter.