I am trying to display the collection properties such as string[] in Fieldchooser. Its being displayed in datagrid but not in FieldChooser. Please let me know what should I do ?
Hello Ramesh,
Thank you for choosing Infragistics.
I have been looking into your issue and I have prepared a sample application for you to test.
Would you please provide me with more detailed information on what you mean by saying collection properties? Are you referring to the properties of the DataItem for each DataRecord? If you keep the AutoGenerateFields property to it's default value (True), then all public properties of your DataItem class are visualized by default as Fields and they are contained within the FieldChooser as well.
Would you please modify the sample application according to your behavior so the issue is reproduced and send it back to me? Having this information would help me further investigate this matter for you.
Please find the updated project attached
Thank you for your feedback.
I have been looking further into your issue and would you please provide me with more detailed information in regards to the functionality you would like to achieve as a whole and what you mean by saying collection properties?
In the sample you have provided, you have created a property that returns an extended List of DataItems with no fields and properties. The XamDataGrid visualizes the expanding indicator by default for every record since there is a collection property for the DataItems of the parent FieldLayout. If you add at least one TestInfo item to the child collection for each record, then you should be able to see a dropdown in the FieldChooser allowing you to choose between the fields for both the parent and the child layout of the XamDataGrid.
Looking forward to hearing from you.
Hi,
I wanted to display all the columns in the field chooser irrespective of the collection has data or not. In my data I observed that string[], List columns are not displayed in field chooser. That's why I specified collection properties in generic.
If the DataItems of your DataRecords contain a List property or an array of strings property as you have described, the XamDataGrid treats them as child collections for every DataItem and a new FieldLayout is created for both of these collections.
The reason for the issue you have described is because the FieldGroupSelector gets updated with the child collections' Fields when the child records have been accessed at least once. This could be achieved by simply expanding a DataRecord or accessing the child records in code behind. After that, by using the FieldGroupSelector in the FieldChooser you should be able to select a FieldLayout and afterwards all its respective Fields will be visualized in the FieldChooser.
If you require any further assistance on this matter, please do not hesitate to ask.
Is it possible to hide the name of the list property or an array of strings property from appearing in XamDatagrid if it has no elements?
I have been looking into the issue you have described in your last post and I have modified the previous sample for you to test.
In order to achieve the behavior you have described in regards to hiding the empty child collections, an approach I can suggest you is to handle the RecordExpanded event of the XamDataGrid as I have done in the sample. Inside it we check if the currently expanded record is a DataRecord and we iterate through its ChildRecords which represent the collections. If any of these collections has any child records, we set it's Visibility property to Visible, otherwise we set it to Collapsed.