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 ?

Bharath PeggemRank #3,303 · 435 reputationPosted Oct 20, 2015, 9:30 PM EDT
Priyaranjan K SRank #45 · 32.5K reputationPosted Oct 20, 2015, 9:29 PM EDT
TVSN Murthy21 reputationPosted Jul 29, 2020, 1:15 AM EDT