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

Get current row index

2 Answers 1445 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rene
Top achievements
Rank 1
Rene asked on 30 Jun 2010, 08:18 AM
Hi,
I'm trying to modify the navigation with the PreviewKeyDown event, but i need the current row index of the selected cell.

Second problem is to activate editing at the selected cell after this function:
        public static void SetSelectedCell(GridViewDataControl gridView, int row, int column)
        {
            gridView.SelectedItem = gridView.Items[row];
            gridView.ScrollIntoViewAsync(gridView.SelectedItem, gridView.Columns[column], (c) => c.Focus());

            //in addition focus grid to enable keyboard navigation(e.g. F2)
            gridView.Focus();
        }

2 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 02 Jul 2010, 09:11 AM
Hi Rene,

 
You can get the index of the SelectedItem with the help of the method IndexOf like:

var rowIndex = this.RadGridView1.Items.IndexOf(this.RadGridView1.SelectedItem);

As for setting a certain cell into edit-mode, you use the Property IsInEditMode and set it to "true":

this.RadGridView1.CurrentCell.IsInEditMode = true;


Greetings,
Maya
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
0
Muhammd
Top achievements
Rank 1
answered on 28 Feb 2018, 12:42 PM
got it 
Tags
GridView
Asked by
Rene
Top achievements
Rank 1
Answers by
Maya
Telerik team
Muhammd
Top achievements
Rank 1
Share this question
or