Hi,
1) Is your given code in GridView1_SelectedIndexChanged() event.
2) Where you set GridView DataSource
if it is in
page_load() event then it should be in
if (!IsPostBack) { GridView1.DataSource = "xyzDataset" }
Please mark it as ans & rate if you find it helps you.
Thank You
Asp.Net/C#.Net Help[
^]
Hemant Singh