C1GridView Filtering with EntityDataSource

Posted by: astarte on 10 September 2017, 11:38 am EST

  • Posted 10 September 2017, 11:38 am EST

    <p>I have a project with MVC and EF - I realise that MVC is not currently supported by C1, but I still need to present a grid bound to the related Entities using EntityDataSource.</p>
    <p><br />The basic view, Sorting, Paging work nicely - but Filtering does not. The filtering event is fired, and the C1GridViewFilterEventArgs is populated correctly - however, the view is not filtered and the query sent to the SQLServer is unchanged.</p>
    <p>A workaround could be to do a custom filter and apply to the Where property of the EntityDataSource - but the main benefit of using C1GridView is that all the work of generating a suitable filter expression is done by the Grid. Is there another way to extract the where clause that should have been applied?</p>
    <p> </p>
    <p>Thanks,</p>
    <p> </p>
    <p>Dave.</p>
    <p> </p>
  • Replied 10 September 2017, 11:38 am EST

    <p>Hi,</p>
    <p>Automatic filtering is only supported for datasources which can be represented as System.Data.DataView.</p>
    <p>In your case you need to create a Filtering event handler and implement code there which filter your datasource.</p>
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels