Display a table based on the selected ListItem
-
Hi, I want to display a table based on the selected item of the listbox. Say I have two tables "Ftable" and "Stable". If item in the listbox is "First" then Ftable should get displayed else Stable should be displayed. I tried, If listbox.selecteditem="First" Then Ftable.visible=true else Stable.visible=true EndIf But it is not working, How else can I do this? Thank you in advance.
Chaitra N
-
Hi, I want to display a table based on the selected item of the listbox. Say I have two tables "Ftable" and "Stable". If item in the listbox is "First" then Ftable should get displayed else Stable should be displayed. I tried, If listbox.selecteditem="First" Then Ftable.visible=true else Stable.visible=true EndIf But it is not working, How else can I do this? Thank you in advance.
Chaitra N
Did you set "AutoPostBack" to true in the properties of ListBox? What error are you getting?
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)
-
Did you set "AutoPostBack" to true in the properties of ListBox? What error are you getting?
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)
I am not getting any errors. But it just not working. I tried the following code also. But of no use. Protected Sub lstselectedtest_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles lstselectedtest.SelectedIndexChanged Dim test As String test = lstselectedtest.SelectedItem.ToString() If test.StartsWith("Pulse Pressure") = True Then Tbpulse.Visible = True bindlist() Else TbOth.Visible = True End If End Sub
Chaitra N
-
I am not getting any errors. But it just not working. I tried the following code also. But of no use. Protected Sub lstselectedtest_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles lstselectedtest.SelectedIndexChanged Dim test As String test = lstselectedtest.SelectedItem.ToString() If test.StartsWith("Pulse Pressure") = True Then Tbpulse.Visible = True bindlist() Else TbOth.Visible = True End If End Sub
Chaitra N
As I wrote:
Did you set "AutoPostBack" to true in the properties of ListBox?
You have to set this property to true to fire "
SelectedIndexChanged
" event. Set the breakpoint to this event and check whether this event is fired or not.. if it is not invoked, you need to set AutoPostBack property to true..Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)
-
As I wrote:
Did you set "AutoPostBack" to true in the properties of ListBox?
You have to set this property to true to fire "
SelectedIndexChanged
" event. Set the breakpoint to this event and check whether this event is fired or not.. if it is not invoked, you need to set AutoPostBack property to true..Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)
I set the AutoPostBack to "True". It is working now. Thank you.
Chaitra N