For C#
Find the control, probably a label, of the data you want to retrieve.
    //Accessing BoundField Column
    string name = GridView1.SelectedRow.Cells[0].Text;
    //Accessing TemplateField Column controls
    string country =       (GridView1.SelectedRow.FindControl("lblCountry") as Label).Text;
    lblValues.Text = "<b>Name:</b> " + name + " <b>Country:</b> " + country;
 
No comments:
Post a Comment