D
Dot Net Daddy
Hello,
I set one of the columns in the GridView to visible=false. But I want
show the value in that column for the selected row, in a Label.
I tried this one, but it didnt work:
Protected Sub GridView1_SelectedIndexChanged(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
GridView1.SelectedIndexChanged
Label3.Text = GridView1.SelectedRow.Cells(3).Text
End Sub
Nothing shows even though the column has data. Then I tried the
following one:
Protected Sub GridView1_SelectedIndexChanged(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
GridView1.SelectedIndexChanged
GridView1.Columns(3).Visible = True
Label3.Text = GridView1.SelectedRow.Cells(3).Text
GridView1.Columns(3).Visible = False
End Sub
But it didn't work either. I think it is because the Page_Load sub
function is run last.
Can you please give any idea how to solve this problem.
Thank you
I set one of the columns in the GridView to visible=false. But I want
show the value in that column for the selected row, in a Label.
I tried this one, but it didnt work:
Protected Sub GridView1_SelectedIndexChanged(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
GridView1.SelectedIndexChanged
Label3.Text = GridView1.SelectedRow.Cells(3).Text
End Sub
Nothing shows even though the column has data. Then I tried the
following one:
Protected Sub GridView1_SelectedIndexChanged(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
GridView1.SelectedIndexChanged
GridView1.Columns(3).Visible = True
Label3.Text = GridView1.SelectedRow.Cells(3).Text
GridView1.Columns(3).Visible = False
End Sub
But it didn't work either. I think it is because the Page_Load sub
function is run last.
Can you please give any idea how to solve this problem.
Thank you