You need to find the row index for the underlying DataTable that the grid is
working off of, not the row index from the grid.
You'll need to do someting like this:
[VB.NET]
Dim dataSetRow As DataRow = dataSet.Tables(0).Select("PrimaryKey =" &
CType(e.Item.FindControl("theTextboxName",Textbox) .Text(0)
Now, dataSetRow represents the row in your DataSet that contains the data
being edited.
So, you can just look at whatever field in that row you want.
<> wrote in message
news: oups.com...
> Hello,
>
> I have a datagrid (.net 1.1) with an edit/update/cancel column. I am
> having trouble capturing the data when the update event fires. It is
> getting whatever was in the textbox before it was changed.
>
> Here is some of my code:
>
> c#
>
> System.Web.UI.WebControls.TextBox p_productDesc = new
> System.Web.UI.WebControls.TextBox();
> p_productDesc = (System.Web.UI.WebControls.TextBox)
> e.Item.Cells[3].Controls[0];
> ....
> sp[0] = new SqlParameter("@productId",e.Item.ItemIndex);
> sp[1] = new SqlParameter("@productDesc",p_productDesc.Text.ToS tring());
>
>
> I also need help with the ItemIndex. I am using paging and it doesnt
> seem to be working right, I need the true ID of the row.
>
> If you need to see more code, just ask! Thanks!
>
|