Is this behavior normal?
Odd rows on edit command are identified acordingly in RowDataBound event. Even however are marked as Row.Type= Header.
EDIT.
I built simple example for debugging, but on this one, for both rows (first and secound) rows are identified as Header in RowDataBound Event (attached)
... so now I'm totally confused. And I ask myself what event can get me access to row which is RowType=DataRow and RowState=Edit, now I'm starting to doubt that there's no such thing :)
This is solution for question edit mode of row in gridview ( I was completely wrong about functionallity of RowDataBound event. Now it is much more clear.
RowDataBound(object sender, GridViewRowEventArgs e)
{
if(e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.RowState == (DataControlRowState.Edit | DataControlRowState.Alternate)) || (e.Row.RowState == DataControlRowState.Edit)
{
// EDIT MODE
}
}
}
Loading
Replies
Know the answer? Post it — somebody with the same question will find it here.