943,783 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 1756
  • C# RSS
Jul 22nd, 2008
0

CheckBoxList Control

Expand Post »
[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?
C# Syntax (Toggle Plain Text)
  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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
C#Novice is offline Offline
11 posts
since Aug 2007
Jul 22nd, 2008
0

Re: CheckBoxList Control

try this :
C# Syntax (Toggle Plain Text)
  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. }
Reputation Points: 1182
Solved Threads: 392
Posting Sensei
Jx_Man is offline Offline
3,138 posts
since Nov 2007
Jul 22nd, 2008
0

Re: CheckBoxList Control

thnx Jx_Man. i will surely try this tomorrow. and let u know.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
C#Novice is offline Offline
11 posts
since Aug 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: Update GridView
Next Thread in C# Forum Timeline: Extracting data from images MIME





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC