Hello,
I'm trying to execute a filter on a XamDataGrid with two levels of hierarchy. I want to filter a field on the "son" records but I do not really successful.
I created a project example to better explain my problem.
In the example, I'm doing exactly the same thing on the first field layout and the second one. For some reason, the filtering is working fine on the first level, but on the second one nothing happens. For that matter, I want to see only records their grade is 90.
Any help will be appreciated.
Hello Roy,
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.
I found a solution to this problem, First, I did a "reset" to the ExpansionIndicator by:
xamDataGrid_RemainsOnLine_ReportMode_GroupAccount.FieldLayoutSettings.ExpansionIndicatorDisplayMode = ExpansionIndicatorDisplayMode.Never; xamDataGrid_RemainsOnLine_ReportMode_GroupAccount.FieldLayoutSettings.ExpansionIndicatorDisplayMode = ExpansionIndicatorDisplayMode.CheckOnDisplay;
Then implements the following code:
foreach (DataRecord rec in xamDataGrid_RemainsOnLine_ReportMode_GroupAccount.Records) { if (rec.ExpansionIndicatorVisibility! = System.Windows.Visibility.Visible) { rec.Visibility = System.Windows.Visibility.Collapsed; } }
It might not be the ideal solution, but it does the job.
Thanks Stefan, it works great.I have another question on that subject, after I make the filtering on the second layout, is there a way to collapes all the records in the first layout which do not have second layer records?For example: Student A has three grades: 40,50,60 and I perform filtering grade = 80. I do not want to see the record of student A at all (On the first layout).
Thank you for your post. I have been looking into it and I can suggest you set the XamDataGrid’s FieldLayoutSettings’ RecordFilterScope to AllRecords in order to achieve the functionality you want. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.