Click to See Complete Forum and Search --> : GridView.....Picking data from row where edit is clicked


Nava
December 22nd, 2006, 11:27 AM
Hi.. I am having problem in
Picking data from row where edit is clicked using GridView

I am using _RowUpdating Procedure for Updating

Now I am having problem in picking up data from the row where edit button was clicked

Let the layout in the GridView be :

sn name address
01 ram kathmandu edit delete
02 sam nagarkot edit delete

Say I clicked edit in (say first row)

Now to update the record I am using Sql like(update tblname set field=newValue..... , WHERE fieldnamewithkey=sthelse)

So I need to trap the new value.

I am using GridView (not DataGrid)

Please help

jasonli
December 22nd, 2006, 01:32 PM
I think in _RowUPdating sub you can get index of edited row.
Dim index as Integer = GridView1.editindex
dim newvalue as string = GridView1.Rows(index).Cells(column_index).Text ' if you use BoundField
dim newvlaue1 as string = CType(GridView1.Rows(index).FindControl("TextBox_ID"), TextBox).Text ' if you use TemplateField


Hope it helps.

Nava
December 23rd, 2006, 11:48 AM
Thanks Jasonli
I have used TemplateField and it worked.
Thank You Very Much Once Again