Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1890
Expand Child Record in Search Functionality
posted

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;

XamDataGridSearchEngine.zip
Parents
  • 30945
    Verified Answer
    Offline posted

    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

    XamDataGridSearchEngine_1.zip
Reply Children
No Data