[DevExpress Support Team: CLONED FROM T211806: dxDataGrid - How to implement the master-detail search panel]
@DevExpress team, appreciate if you can provide working example here on how to search across Master and Detail rows (either collapse or expanded)
Hello,
We don't have a ready-to-use sample for this scenario. You can try to implement the suggested solution step by step. If you encounter any issues on the way, share a sample illustrating your progress. You can use our demos as a starting point. We will examine this sample and do our best to assist you.
Hi. I need to look into other issues currently. Will definitely get back to this after next week,
I tried the steps, and search on MasterGrid works fine.
<div style="width: 100%; display: table;"> <div style="display: table-row"> <div style="width: 300px; display: table-cell;"> @(Html.DevExtreme().TextBox() .Placeholder("Search here...") .ID("txtSearch") .ShowClearButton(true) .OnValueChanged(@<text> function(e){ if (e.value) { $("#objectGrid").dxDataGrid("instance").filter("SSCC", "contains", e.value); $("#objectGrid").dxDataGrid("instance").expandAll(-1); } else { $("#objectGrid").dxDataGrid("instance").clearFilter(); } } </text>) ) </div> <div style="width: 300px; display: table-cell;"> </div> </div> </div>
But if I understand correctly, to search at details level, I need to expandAll(). But in my case this is remote connection. Hence I can't really use this method.
Hello,
You are right, DataGrid doesn't access the detailed grids till they are shown. As Nikolai mentioned, you can filter them in the onRowExpanded event handler.
Please try to implement it and keep me informed of your progress. We are here to help you.
Sorry for revisiting this thread rather after awhile, but I just manage to resume back this task.
So rather than trying to expand all rows to search, I thought of making search at server level.
What I would like to do now i to identify if user is searching for parameter in child level and perform the filter in my LINQ.
foreach (var item in loadOptions.Filter ?? Array.Empty<string>()) { if (item.ToString().Contains("ItemID")) { string search = loadOptions.Filter[2].ToString(); m = from p in m join l in WhContext.Receipt_Lines on p.ReceiptID equals l.ReceiptID where l.ItemID.Contains(search) select p; loadOptions.Filter = null; break; } }
I would like to make loadOptions.Filter to be null once the filter is applied, so that it doesn't come back in case user tries to filter using Datagrid.SearchPanel.
However when user enters SearchPanel, ItemID is yet returned again.
[0]: {[ [ "Manifest", "contains", "Fred" ], "or", [ "Consignment", "contains", "Fred" ], "or", [ "Notes", "contains", "Fred" ], "or", [ "SSCC", "=", "Fred" ], "or", [ "PO_RefNo", "contains", "Fred" ], "or", [ "ASN_RefNo", "contains", "Fred" ], "or", [ "LocationID", "contains", "Fred" ], "or", [ "Device", "=", "Fred" ], "or", [ "ReceiptID", "contains", "Fred" ], "or", [ "UpdateBy", "contains", "Fred" ], "or", [ "CreatedBy", "contains", "Fred" ] ]} [1]: "and" [2]: {[ "ItemID", "contains", "WPMB" ]}
Hello,
It is not clear where you are going to check the filter expression. Could you please send us a simple working sample with mock data illustrating the issue? We will research it and do our best to put you on the right track.
Hi Lena,
Hopefully this video is sufficient to illustrates the problem.
http://somup.com/cYi1nGQmw1
(Do enable the captions)
Hello,
Thank you for the screencast. I see that you reproduce the issue. But to determine its source and find the most suitable solutions, we need to replicate it locally. For this, we need to debug your implementation and learn how you create a filter expression. So could you send us a simple working project illustrating the issue in action?
A request for simple example programs
Hi Lena,
If you could provide me a template of ASP.NET MVC project with sample master-detail grid dataset, I will be able to get back to you quickly.
Really would appreciate it.
Hello,
Unfortunately, we don't have a ready sample with a Master-Detail interface in MVC. I suggest you create a new DevExtreme Template project. It contains DataGrid out of the box. You can add a master-detail to it (use the Master-Detail demo as a starting point).
I look forward to your progress.
Hi Lena,
Please find the sample project attached.
To reproduce :
Expectation:
If user enters search in Grid Search Panel, the filter outside in dxTextBox is ignored.
Meaning both searches are independent.
Hello,
Thank you for the sample. We are working on it and need some additional time to research the issue in greater detail. We will let you know of our progress once we have any results. I hope you will excuse any delay that may arise.
Any update here?
Hello,
Please accept my apologies for this delay. I researched your sample and found that the issue occurs because you pass an empty array (the m variable) to the DataSourceLoader.Load method. Refer to this screenshot:

Please make sure that your SQL request works correctly and returns correct data. I look forward to your reply.
Lena,
There is nothing wrong with my model. Issue here is, I'm trying to nullify the filter condition once filter is applied, so that in next call it will ignore my previous filter.
Watch the video again
http://somup.com/cYi1nGQmw1
(Do enable the captions)
Hello,
The DataSourceLoader.Load method accepts an array as the first argument. It uses the loadOptions argument to filter this array. In your sample, you pass an empty array to the DataSourceLoader.Load method (you can see it in the screenshot above).
As for the filter, I double-checked your project and see that it is applied:

Here you can see that the null value is assigned. As a result, the filter won't be applied. If you expect a different behavior, please elaborate on how you debug your project and describe the results you wish to achieve. A screencast that illustrates your steps will be helpful.
I look forward to your reply.
Hi Lena,
I hope this video explains the issue.
http://somup.com/cYQfI8XbxW