Hello,
I'm using the xamDataGrid to display some hierarchical data.
I have been looking for a way to expand or collapse a specific row from the code-behind. I know that it is possible to expand the complete grid from code-behind, but I only want to expand a specific row/item.
Is this possible?
Hello Christian,
Thank you for your post. I have been looking into it and I suggest you see this link from our online documentation:
http://help.infragistics.com/NetAdvantage/WPF/2011.2/CLR4.0/?page=xamDataPresenter_Iterate_through_the_Records_Collection.html
where it is shown how to iterate through all the Records. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
Hello Stefan,
Thanks for your post!
I do have some trouble implementing it though.
The DataSource of my xamDataGrid is set to a collection of objects of type vmCalculation.
I need to convert the ExpandableFieldRecord to this type so I can compare an id in the vmCalculation to a list of ids.
Hello Priyanka,
You can handle your data source's CollectionChanged event and inside its handler you can expand the records. You can also check if the event is fired due to an add to the collection to be sure there are items in the collection.
Hope this helps you.
Hi Stefan,
I am having similar issue. I want to expand first row of DataGrid. Issue is data source of grid is coming from service. which is taking time. Willing to know How can I check data binding is done and based upon that I can expand only first row.
Thanks in advance,
Priyanka
Hello again,
You can cast the ExpandableFieldRecord’s ParentDataRecord’s DataItem to vmCalculations like this:
(expandableRecord.ParentDataRecord.DataItem as vmCalculation)