J
Joey
asp.net 2/C#/VS2005
I have a webform that contains gridview that is databound to a dataset
maintained in session state. Users can enter values into textboxes and
add to the grid. For each row in the grid, there is a command field
called Delete...it allows them to remove the entries if necessary. I
can add just fine from both IE and Firefox, and I can delete just fine
from IE. But when I try to delete a row from Firefox, I get the
following error...
Thre is no row at position 0
....I am handling the delete in the gridview's RowDeleting handler.
Below is the code...
protected void grdMyGrid_RowDeleting(object sender,
GridViewDeleteEventArgs e)
{
((DataSet)this.Session["MyDataSet"]).Tables["MyTable"].Rows[e.RowIndex].Delete();
this.grdMyGrid.DataSource=((DataSet)this.Session["MyDataSet"]);
this.grdMyGrid.DataMember="MyTable";
this.grdMyGrid.DataBind();
}
....the first line inside the function block is what throws the error.
In debug mode I can see that e.RowIndex is always equal to 0. So why
does this work fine in IE but not in Firefox? Why am I getting the
error when using Firefox?
TIA
I have a webform that contains gridview that is databound to a dataset
maintained in session state. Users can enter values into textboxes and
add to the grid. For each row in the grid, there is a command field
called Delete...it allows them to remove the entries if necessary. I
can add just fine from both IE and Firefox, and I can delete just fine
from IE. But when I try to delete a row from Firefox, I get the
following error...
Thre is no row at position 0
....I am handling the delete in the gridview's RowDeleting handler.
Below is the code...
protected void grdMyGrid_RowDeleting(object sender,
GridViewDeleteEventArgs e)
{
((DataSet)this.Session["MyDataSet"]).Tables["MyTable"].Rows[e.RowIndex].Delete();
this.grdMyGrid.DataSource=((DataSet)this.Session["MyDataSet"]);
this.grdMyGrid.DataMember="MyTable";
this.grdMyGrid.DataBind();
}
....the first line inside the function block is what throws the error.
In debug mode I can see that e.RowIndex is always equal to 0. So why
does this work fine in IE but not in Firefox? Why am I getting the
error when using Firefox?
TIA