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

Clearing Selection

3 Answers 138 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 21 Oct 2008, 08:03 PM
Hi,

I have a problem when re-loading a radgridview with a new dataset where I am unable to clear the selected rows.
So if row 3 is selected in the grid, I reload the dataset and set it as the Datasource for the grid. The grid reflects the changed data. I call RadGridView.SelectedRows.Clear(), but row 3 remains selected (at least it remains highlighted)
I have tried clearing the seleced rows before loading the new dataset and afterwards, but it doesn't seem to make any difference.

I am using Q2 2008 SP1, having just upgraded from Q3 2007

Is there a solution to this?

Thankyou.

3 Answers, 1 is accepted

Sort by
0
kae
Top achievements
Rank 1
answered on 23 Oct 2008, 03:32 AM
I've got same problem, too.
Please, tell me if you can fix problem.
0
kae
Top achievements
Rank 1
answered on 23 Oct 2008, 04:04 AM
OK, Paul

I can fix this problem.

Code:
Dim x As Integer = 5
Dim row As GridViewRowInfo
row = GridView.Rows(x)
GridView.GridNavigator.SelectRow(row)

Output: Row(5) is selected

I think you can use GridView.GridNavigator.Initialize(GridView) to clear selection or select rowIndex -1
0
Nikolay
Telerik team
answered on 27 Oct 2008, 10:48 AM
Hello guys,

I tried to reproduce the issue, but I could not. Therefore please open new support tickets and send me your sample projects which reproduce it. This will allow me to address any potential issue further and to give you more accurate help. I am attaching a sample project which is working correctly on my side. Please notice that after the TableAdapter is refilled, the selection in RadGridView is reset - only the first row is selected.

I am looking forward to your responses.

Best wishes,
Nikolay
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
GridView
Asked by
Paul
Top achievements
Rank 1
Answers by
kae
Top achievements
Rank 1
Nikolay
Telerik team
Share this question
or