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

How can i compare two Grid Views With Hierarchical levels.

3 Answers 207 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sagar
Top achievements
Rank 1
Sagar asked on 04 Dec 2010, 06:44 AM
Hi,
I have two data Grids. One with the new data and the other with the old data, Both have Hierarchy . And how can i show the New added rows.

Thanks & Regards,
Sagar

3 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 04 Dec 2010, 09:48 AM
Hi Sagar,

Are you trying to compare two grids with different datasources, or are you just looking to mark new, user added rows in a RadGridfView?

thanks
Richard
0
Accepted
Emanuel Varga
Top achievements
Rank 1
answered on 04 Dec 2010, 11:56 AM
Hello Sagar,

Just implement Equals in your datasource objects if you are using business objects and parse the two data sources, or if you are using DataSets you will have to either create a custom equality comparer or to create a method that handles the comparison of two rows.
After that just parse either the rows of the table comparing their data bound items, or the data source itself, it depends on what you have to do next.

Hope this helps, if you have any other questions or comments, please let me know,

Best Regards,
Emanuel Varga

Telerik WinForms MVP
0
Julian Benkov
Telerik team
answered on 08 Dec 2010, 03:49 PM
Hello Sagar,

One of possible solutions in RadGridView is to use the ChildRows property of every grid and make a recursion function to compare values for every row. The other possible approach is to make an external comparer, just like Emanuel has suggestied.

All the best,
Julian Benkov
the Telerik team
Get started with RadControls for WinForms with numerous videos and detailed documentation.
Tags
GridView
Asked by
Sagar
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Emanuel Varga
Top achievements
Rank 1
Julian Benkov
Telerik team
Share this question
or