C
Calson33
I created a datagrid with an edit button which redirects to another
page for editing. This seemed to work fine. Then, I added a way to
search which just modified the SQL by adding a WHERE clause (I know,
it's going to be put into a stored proc, just trying to get it to work
for now).
This also seemed to work... Until I clicked on the edit button. It
brings up the wrong record.
I tried
mygrid.DataKeys[e.Item.ItemIndex].ToString()
and then I put the primary key into a column, and tried
e.Item.Cells[0].Text
which also brings up the wrong primary key. The really wierd thing is
that the correct primary key is displayed in the column.
Can anyone help me?
page for editing. This seemed to work fine. Then, I added a way to
search which just modified the SQL by adding a WHERE clause (I know,
it's going to be put into a stored proc, just trying to get it to work
for now).
This also seemed to work... Until I clicked on the edit button. It
brings up the wrong record.
I tried
mygrid.DataKeys[e.Item.ItemIndex].ToString()
and then I put the primary key into a column, and tried
e.Item.Cells[0].Text
which also brings up the wrong primary key. The really wierd thing is
that the correct primary key is displayed in the column.
Can anyone help me?