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

CellBeginEdit e.rowindex is incorrect

2 Answers 176 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 17 Nov 2010, 12:15 AM

I need to interrogate a cell on the row being edited to determine if editing is allowed. The cell I'm trying to retrieve is a hidden column, not the one the user is trying to edit. When I look at the value of e.rowindex it doesn't match the row being edited. The grid is a hierarchy view. The value of e.rowindex seems to be associated with the rows being displayed at that hierarchy level.

How can I get the row being edited?

I switched over to the latest release and this fixed the problem.

2 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 17 Nov 2010, 01:13 AM
Hi Tim,

I don't have access to my dev environment right now, but I know you can get to the current row  by using :

Me.RadGridView.CurrentRow

hope this helps
let me know if you need more info
Richard
0
Accepted
Emanuel Varga
Top achievements
Rank 1
answered on 17 Nov 2010, 07:59 AM
Hello,

Just use e.Row to access all the cells in that row, like so:
void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
{
    var value = e.Row.Cells[0];
}

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

Best Regards,
Emanuel Varga
Telerik WinForms MVP
Tags
GridView
Asked by
Tim
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Emanuel Varga
Top achievements
Rank 1
Share this question
or