Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checkbox.Checked Not There
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01408479
Message ID:
01408482
Views:
30
Because oControl is of type Control, not RadioButton. There's no Checked property to the Control class. You have to cast it:
((RadioButton)oControl).Checked = Convert.ToBoolean(_DataRow[1]);
>Control oControl = null;
>Then later...
>oControl = new MyRadioButton();
>oControl.Text = sCaption;
>oControl.Checked = Convert.ToBoolean(_DataRow[1]);
>I'm getting
>'System.Windows.Forms.Control' does not contain a definition for 'Checked' and no extension method 'Checked' accepting a first argument of type 'System.Windows.Forms.Control' could be found
>Here's MyRadioButton
>class MyRadioButton : RadioButton
>{
>}
>So why isn't the Checked property there?
Previous
Reply
Map
View

Click here to load this message in the networking platform