S
Scot
I have dropped a DataGrid (.NET Framework 1.1) on a page, and using the VS
DataGrid Property Wizard, have added a button column with Edit, Update,
Cancel.
The grid displays correctly and when I click the Edit button, I get the
expected result of the Edit Command being triggered. My problem is that
once I change a value and click the Update button, the EditCommand is being
triggered, not the UpdateCommand.
Does anyone have any ideas about what I might have done wrong / forgotten to
set up.
Thanks in advance, code to follow.
Scot
private void InitializeComponent()
{
this.DataGridItemGrid.CancelCommand += new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.DataGridItemGrid_
CancelCommand);
this.DataGridItemGrid.EditCommand += new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.DataGridItemGrid_
EditCommand);
this.DataGridItemGrid.UpdateCommand += new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.DataGridItemGrid_
UpdateCommand);
this.Load += new System.EventHandler(this.Page_Load);
}
private void DataGridItemGrid_EditCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
DataGridItemGrid.EditItemIndex = e.Item.ItemIndex;
BindData();
}
private void DataGridItemGrid_UpdateCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
PriceUpdater.StoreUpdater su = new PetShop.Web.PriceUpdater.StoreUpdater();
bool updateValid = su.UpdatePrices(ds);
}
DataGrid Property Wizard, have added a button column with Edit, Update,
Cancel.
The grid displays correctly and when I click the Edit button, I get the
expected result of the Edit Command being triggered. My problem is that
once I change a value and click the Update button, the EditCommand is being
triggered, not the UpdateCommand.
Does anyone have any ideas about what I might have done wrong / forgotten to
set up.
Thanks in advance, code to follow.
Scot
private void InitializeComponent()
{
this.DataGridItemGrid.CancelCommand += new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.DataGridItemGrid_
CancelCommand);
this.DataGridItemGrid.EditCommand += new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.DataGridItemGrid_
EditCommand);
this.DataGridItemGrid.UpdateCommand += new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.DataGridItemGrid_
UpdateCommand);
this.Load += new System.EventHandler(this.Page_Load);
}
private void DataGridItemGrid_EditCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
DataGridItemGrid.EditItemIndex = e.Item.ItemIndex;
BindData();
}
private void DataGridItemGrid_UpdateCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
PriceUpdater.StoreUpdater su = new PetShop.Web.PriceUpdater.StoreUpdater();
bool updateValid = su.UpdatePrices(ds);
}