Ticket T873879
Visible to All Users

DataGrid - How to search across the master and detail rows

created 5 years ago (modified 5 years ago)

[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)

Show previous comments (14)
RS RS
Randeep Singh 1 5 years ago

    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)

    DevExpress Support Team 5 years ago

      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.

      RS RS
      Randeep Singh 1 5 years ago

        Hi Lena,

        I hope this video explains the issue.

        http://somup.com/cYQfI8XbxW

        Answers approved by DevExpress Support

        created 4 years ago

        Hello,

        Please accept my apologies for this delay. We researched your scenario and found a possible solution for you.
        You implement custom filtering using the DataGrid filter() method. This method keeps the filter expression in the DataGrid and then DataGrid sends this expression to the DataSourceLoader. When you apply multiple filters to the DataGrid, all the filters are kept in the DataGrid and then DataGrid sends all these filters to the DataSourceLoader. That's why your previous implementation with the loadOptions.Filter = null; doesn't work. As a possible solution, you can override the filter expression on the client-side as follows:

        Razor
        @(Html.DevExtreme().DataGrid<SampleOrder>() .OnOptionChanged("OnOptionChanged")
        JavaScript
        function OnOptionChanged(e) { if (e.name = "columns" && e.fullName.includes("filterValue")) { e.component.getDataSource().filter(null); } }

        I updated your sample to illustrate this solution in action. Please let me know if it is what you are looking for.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.