I have demo project attached where I can search parent and child records for a value with a custom search control. I was wondering is there a way to trigger the parent child to expand when a search result is in the child record after the user clicks the next button in the Searchbar control?
I tried the following code but it didn't work:
(resultRecords[currentIndex]).ParentRecord.IsExpanded = true;
Hello,
Thank you for your reply. I have been looking into the issue that you have described and in order to expand the records from the child to the root parent, you can use the ParentDataRecord and the following code, that goes to the top level parent:
if (resultRecords[currentIndex].ParentRecord != null)
{
Record parent = resultRecords[currentIndex].ParentDataRecord;
while (parent != null)
parent.IsExpanded = true;
parent = parent.ParentDataRecord;
}
I am attaching a modified version of the sample that you have attached, that uses the code to implement the funcitonlity that you have described.
Please let me know if you need any further assistance on the matter.
Sincerely,
Krasimir, MCPD
Developer Support Supervisor - XAML
Infragistics
www.infragistics.com/support
Thank you, this helped.
Thank you for your reply. I am very glad that the approach I have suggested was helpful. Please let me know if you need any further assistance on the matter.