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

GridView Selected row

1 Answer 203 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Juzzer
Top achievements
Rank 2
Juzzer asked on 10 Dec 2007, 02:59 PM
Hi there,

I have a Grid in a win app and want to select the current row when the user refreshes the grid so use:

            radGridView1.Rows[someIndex].IsSelected = true;
            radGridView1.GridElement.Update(false);

The above code kinda works but the first row of the grid is always selected as well. More than likely i'm missing the obvious.

Cheers
J



1 Answer, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 11 Dec 2007, 12:10 PM
Hello Juzzer,

Thank you for writing us.

The IsSelected property indicates that the row was selected. RadGridView can contain multiple selected rows and they can be accessed through the SelectedRows property of RadGridView. When you mark some row as selected it will be automatically added in the SelectedRows collection.

The IsCurrent property indicates which is the currently selected row. Only one row in RadGridView can be marked as current. The current row is synchronized with the Position property of the CurrencyManager associated with your data source.

I would suggest using the IsCurrent property instead of the IsSelected property.

In case you need further assistance, we will be glad to help you.

 
Kind regards,
Jack
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
GridView
Asked by
Juzzer
Top achievements
Rank 2
Answers by
Jack
Telerik team
Share this question
or