This is a migrated thread and some comments may be shown as answers.

compare two GridView

1 Answer 22 Views
GridView
This is a migrated thread and some comments may be shown as answers.
ITA
Top achievements
Rank 1
ITA asked on 15 Jun 2012, 10:02 AM
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

1 Answer, 1 is accepted

Sort by
0
Nick
Telerik team
answered on 20 Jun 2012, 06:32 AM
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 >>

Tags
GridView
Asked by
ITA
Top achievements
Rank 1
Answers by
Nick
Telerik team
Share this question
or