D
dev648237923
I have a Requery() function for my data.
I call it when !Page.IsPostback to fill the grid (so I set the DataSource
and call DataBind manually).
Now my user clicks Edit in the grid so now RowEditing fires.
In RowEditing I do:
gv.EditIndex = e.NewEditIndex;
Requery();
That all works -- but my concern is: what if someone else added rows in
between the time I did my initial requery (!Page.IsPostback) and the time I
do it now in RowEditing? In that case Requery() will not return the same
DataSet and so the EditIndex I thought I had is in fact different. I tested
this and sure enough that is the case.
How can this problem be handled?
Thanks for any ideas!!!
I call it when !Page.IsPostback to fill the grid (so I set the DataSource
and call DataBind manually).
Now my user clicks Edit in the grid so now RowEditing fires.
In RowEditing I do:
gv.EditIndex = e.NewEditIndex;
Requery();
That all works -- but my concern is: what if someone else added rows in
between the time I did my initial requery (!Page.IsPostback) and the time I
do it now in RowEditing? In that case Requery() will not return the same
DataSet and so the EditIndex I thought I had is in fact different. I tested
this and sure enough that is the case.
How can this problem be handled?
Thanks for any ideas!!!