Sunday, November 19, 2006

Get Values From Grid View To Update it

Hi Folks,

i got a question from one of our boomers to how can he get values from gridview to update values.
here,is the answer.

Way #1 :
string test = MyGV.Rows[indx].Cells[1].Text ;

Way #2 : if you want to get DataKey value from GridView
string test=MyGV.DataKeys[0].Value.ToString()

Way #3:


let me know if you need any other help my friend "Raheel Rasheed".

Moustafa arafa


Unknown said...

can you plase tell how retrieve new values . thanks in advance..

Unknown said...

to retrieve the new values,use 3rd way because it seems that your column is not a datakey column.

if you need any other help please let me know.

Anonymous said...

how do i get the the datakey of a row which i selected so i can use that key for futher operations like update ect.

Anonymous said...

addition to my post the 3rd technique does not tell which method to place it in. Would like to do this in a RowCommand when a press a button.