2
Reply

Gridview

Shreyas Tg

Shreyas Tg

Oct 21 2015 12:59 AM
260
I am storing the value of gridview into a string. I have two lines of code.
string UserName = GridView1.Rows[e.RowIndex].Cells[4].Text.ToString(); 1
string UserName = GridView1.Rows[e.RowIndex].Values["UserName"].ToString(); 2
Both will have same Values. Which is the better option to use 1 or 2 ?

Answers (2)