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

Updating datatable underlying radgridview, nothing else changes.

2 Answers 169 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mike Renwick
Top achievements
Rank 1
Mike Renwick asked on 17 Feb 2010, 12:58 PM
Hi there,

I'm trying to update the dataset underneath a gridview by calling rgvRatings.Refresh()

I've noticed some strange behaviour: Firstly, the sort order within groups, as selected by the user doesn't always seem to persist after the refresh, and secondly, the "currentRow" can sometimes move to the next row?  Trying to solve the combination has been ... fiddly.

I've tried using LoadLayout/SaveLayout to a string, but this collapses expanded groups.  I would attempt to handle that programmatically by storing the "expanded" state, but there are "n" levels of grouping (it's basically up to the user) so this seems like a headache to achieve and test.

Is there someway I can force the grid to update the data in all of its cells without changing *anything* else about the state of the grid?

I'm using Q2 2009 SP1 btw.

Regards,
Mike

2 Answers, 1 is accepted

Sort by
0
Mike Renwick
Top achievements
Rank 1
answered on 17 Feb 2010, 01:01 PM
Uh, one additional complexity, the grid is bound to a DataView that has a filter "IsVisible='True'".  I am attempting to manually manipulate the underlying datatable, where there are basically two rows for every row in the grid, only one of which should be visible at a time.

The idea is I can find a row's "matching pair" and toggle it's "IsVisible" field value, and refresh the grid when a checkbox is checked, to show the other row.

This actually works (sometimes) when the ordering persists.


0
Martin Vasilev
Telerik team
answered on 22 Feb 2010, 07:52 AM
Hi Mike Renwick,

Thank you for writing. I am afraid that I cannot understand your scenario very well. However, you can try to use Update method instead of Refresh to update RadGridView UI:

this.radGridView1.GridElement.Update(GridUINotifyAction.Reset);

If this does not help, please open a new support ticket and send me a small example application. This will help me better understand your scenario and provide accurate assistance.

Sincerely yours,
Martin Vasilev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
Mike Renwick
Top achievements
Rank 1
Answers by
Mike Renwick
Top achievements
Rank 1
Martin Vasilev
Telerik team
Share this question
or