compare two GridView

2 posts, 0 answers
  1. ITA
    ITA avatar
    383 posts
    Member since:
    Aug 2009

    Posted 15 Jun 2012 Link to this post

    Hi,

    is there any easy way to compare to RadGridViews? Ihave two GridViews with the same ViewModel. GridViewA is the source
    and GridViewB ist the target.
    On Application Load i bind first the RadGrievB with Data from a Database. Afterwards i want to bind GridViewA from a second source.
    But All the Items which are in GridViewA may not be in GridViewA. I hope this is clear!?

    Is there a easy way to handle it? Or must i select each item from database to check if it is in the GridViewB?

    GridViewA:
    Source = txt-file
    ViewModel=Pakete

    GRidViewB:
    Source=Database (original source txt-file)
    Viewmodel=Pakete

    Thanks a lot
    Regards
    Rene
  2. Nick
    Admin
    Nick avatar
    593 posts

    Posted 20 Jun 2012 Link to this post

    Hello Rene,

    Is there a easy way to handle it? Or must i select each item from database to check if it is in the GridViewB? 
    This depends on the approach you are using to get the data. For instance, if you are using EntityFramework, you could load the second items source like:

    var itemsSource = DBEntities.Foos.Where(x => !GridViewB.ItemsSource.Contains(x))

    Other than that you will have to loop through the items and take out the ones that you don't need.

    Hope this helps!  All the best,
    Nik
    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
Back to Top