TechShri from Shriniwas Wani

Custom Search

13 July, 2006

EditItemTemplate Methods...

Some common methods for EditItemTemplate -

protected void Grid_Edit(Object sender, DataGridCommandEventArgs e)
{
Grid.EditItemIndex = e.Item.ItemIndex;
Grid.DataSource = GetDataForGrid();
Grid.DataBind();

}
protected void Grid_Cancel(Object s, DataGridCommandEventArgs e)
{
Grid.EditItemIndex = -1;
Grid.DataSource = GetDataForGrid();
Grid.DataBind();

}


Where GetDataForGrid() method returns DataTable

0 Comments:

Post a Comment

<< Home