Select from following answers:- GridView1.EditIndex = -1
- GridView1.EditIndex = 0
- GridView1.EditIndex = 1
- GridView1.EditIndex = e.NewEditIndex
- All Above
We must write GridView1.EditIndex = e.NewEditIndex to Edit any Gridview Rows.
As we know that, we have both ItemTemplate as well as EditItemTemplate in Gridview. ItemTemplate is for Viewing rows and EditItemTemplate is for Editing any gridview rows.
When calling GridView1.EditIndex = e.NewEditIndex, then it will call EditItemTemplate implicitely. And whatever controls we have taken inside EditItemTemplate, will be visible and load, so that we can update the their' contents. After clicking on Edit Icon/Button, Update icon will be displayed.
Show Correct Answer
Asked In: Many Interviews |
Alert Moderator