Getting results as DataTable

5 posts, 1 answers
  1. Shawn
    Shawn avatar
    39 posts
    Member since:
    Jul 2012

    Posted 17 Oct 2011 Link to this post

    I have a DataTable that is the source for my DataFilter but I need to get the FilteredSource as a DataTable back out. Is there an easy way to accomplish this using the current control?

    Thanks,
    Shawn
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 20 Oct 2011 Link to this post

    Hello,

     Can you clarify why you need this?

    Regards,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Shawn
    Shawn avatar
    39 posts
    Member since:
    Jul 2012

    Posted 20 Oct 2011 Link to this post

    We have an existing set of code that utilizes the Telerik ORM to create a DataTable from an open-ended database structure. Due to the dynamic nature of the data being pulled/created, Telerik recommended this approach. We have now written code that generates a report based on the DataTable structure but our customer has requested the ability to filter certain parts of the results from the UI.

    In playing around with the DataFilter, we found it could easily answer this as it can filter the DataTable results without a problem but the output was in a ItemDataCollection format which is not compatible with the other code that already exists. Since the report generation code is complex and our time is short for delivery, it is not something we ideally want to rewrite.

    I wanted to know if there is a simple way to convert the ItemDataCollection to a DataTable.

  5. Answer
    Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 20 Oct 2011 Link to this post

    Hi,

     You can use the approach from this thread:
    http://stackoverflow.com/questions/1253725/convert-ienumerable-to-datatable

    Best wishes,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  6. Shawn
    Shawn avatar
    39 posts
    Member since:
    Jul 2012

    Posted 21 Oct 2011 Link to this post

    Thanks. That code example worked for me.
Back to Top
UI for WPF is Visual Studio 2017 Ready