I was going through an article on datagrid control in ASP.NET and found the
use of databind a bit confusing.
So the default behavior in a editable datagrid row is to show a Update and a
Cancel Button when a user wants to edit the datagrid.
What I found confusing was the use of databinding when this cancel button is
pressed. When we are pressing the Cancel button we are not changing the
datasource...then why do we need to re-bind the web control to the datasource.
DataGrid1.EditItemIndex = -1
DataGrid1.DataBind()
Similarily we use databind to re-bind the datagrid, when the user clicks the
row he wants to edit.
DataGrid1.EditItemIndex = e.Item.ItemIndex
DataGrid1.DataBind()
What am I missing here?
Regards,
-Aayush