CheckBoxList Control

Please support our C# advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Aug 2007
Posts: 10
Reputation: C#Novice is an unknown quantity at this point 
Solved Threads: 0
C#Novice C#Novice is offline Offline
Newbie Poster

CheckBoxList Control

 
0
  #1
Jul 22nd, 2008
[I have an application where , i have a radiobuttonlist having 2 radio buttons radiobuttons RB1 & RB2
and there are 6 checkBoxes CB1 thru CB6
If RB1 is selected then CB6 shld be disable /invisible and if RB2 is selected then all the CBs shld be enabled. How do i do this?
  1. protected void rb_OnIndexChanged(object sender, System.EventArgs e)
  2. {
  3. if (rb.SelectedValue=="A")
  4. {
  5. cb6.Enabled=true;
  6. }
  7. }
i get an error Object reference not set to an instance of an object
plz help.
thank you
Last edited by Tekmaven; Jul 22nd, 2008 at 7:37 pm. Reason: Code tags
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: CheckBoxList Control

 
0
  #2
Jul 22nd, 2008
try this :
  1. private void RB1_CheckedChanged(object sender, System.EventArgs e)
  2. {
  3. if (RB1.Checked == true)
  4. {
  5. C1.Enabled = true;
  6. C2.Enabled = true;
  7. C3.Enabled = true;
  8. C4.Enabled = true;
  9. C5.Enabled = true;
  10. C6.Enabled = false;
  11. }
  12. }
  13.  
  14. private void RB2_CheckedChanged(object sender, System.EventArgs e)
  15. {
  16. if (RB2.Checked == true)
  17. {
  18. C1.Enabled = false;
  19. C2.Enabled = false;
  20. C3.Enabled = false;
  21. C4.Enabled = false;
  22. C5.Enabled = false;
  23. C6.Enabled = false;
  24. }
  25. }
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 10
Reputation: C#Novice is an unknown quantity at this point 
Solved Threads: 0
C#Novice C#Novice is offline Offline
Newbie Poster

Re: CheckBoxList Control

 
0
  #3
Jul 22nd, 2008
thnx Jx_Man. i will surely try this tomorrow. and let u know.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C# Forum


Views: 1057 | Replies: 2
Thread Tools Search this Thread



Tag cloud for C#
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC