Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > GridView.Cells

Reply
Thread Tools

GridView.Cells

 
 
Dot Net Daddy
Guest
Posts: n/a
 
      08-04-2006
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57