Showing posts with label radiobutton. Show all posts
Showing posts with label radiobutton. Show all posts

Thursday, March 29, 2012

set column distances for RadioButtonList

Hello,
I have a radioButtonList and set RepeatColumns to 2.
However, the distance between radiobutton in column1 and radiobutton
in column2 is too close.
Can someone how to set the distance (either with CSS or not)?
Many Thanks
JerryHave you tried using cellspacing for the radiobuttonlist?
I mean something like
<asp:RadioButtonList ID="RadioBtnList" runat="server" RepeatColumns="2"
CellSpacing="10">
<asp:ListItem>Item 1</asp:ListItem>
<asp:ListItem>Item 2</asp:ListItem>
<asp:ListItem>Item 3</asp:ListItem>
<asp:ListItem>Item 4</asp:ListItem>
<asp:ListItem>Item 5</asp:ListItem>
<asp:ListItem>Item 6</asp:ListItem>
</asp:RadioButtonList>
--
>From: DAXU@.hotmail.com
>Newsgroups: microsoft.public.dotnet.framework.aspnet
>Subject: set column distances for RadioButtonList
>Date: Tue, 4 Dec 2007 08:23:18 -0800 (PST)
>Organization: http://groups.google.com
>Lines: 11
>Message-ID:
<5b0fa9e7-9fe6-4fca-8150-56abb4a67d6e@.f3g2000hsg.googlegroups.com>
>NNTP-Posting-Host: 80.5.93.39
>Mime-Version: 1.0
>Content-Type: text/plain; charset=ISO-8859-1
>Content-Transfer-Encoding: 7bit
>X-Trace: posting.google.com 1196785399 22323 127.0.0.1 (4 Dec 2007
16:23:19 GMT)
>X-Complaints-To: groups-abuse@.google.com
>NNTP-Posting-Date: Tue, 4 Dec 2007 16:23:19 +0000 (UTC)
>Complaints-To: groups-abuse@.google.com
>Injection-Info: f3g2000hsg.googlegroups.com; posting-host=80.5.93.39;
> posting-account=a-mEAAoAAABlXzZHzkVMW2qA_BbvR8Hj
>User-Agent: G2/1.0
>X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US;
rv:1.8.1.11)
> Gecko/20071127 Firefox/2.0.0.11,gzip(gfe),gzip(gfe)
>Content-Disposition: inline
>Path:
TK2MSFTNGHUB02.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTFEEDS02.phx.gbl!newsfeed0
0.sul.t-online.de!t-online.de!news.glorb.com!postnews.google.com!f3g2000hsg.
googlegroups.com!not-for-mail
>Xref: TK2MSFTNGHUB02.phx.gbl microsoft.public.dotnet.framework.aspnet:52366
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
>Hello,
>I have a radioButtonList and set RepeatColumns to 2.
>However, the distance between radiobutton in column1 and radiobutton
>in column2 is too close.
>Can someone how to set the distance (either with CSS or not)?
>Many Thanks
>Jerry
>
Thank You,
Nanda Lella,
This Posting is provided "AS IS" with no warranties, and confers no rights.

Monday, March 26, 2012

Set Enabled to false for multiple web controls

Hi,
I have a usercontrol which contains multiple server controls like
textbox, radiobutton..., I have a public field in the usercontrol
"Enabled". What i want to do is when the usercontrol's "Enabled" is
set to false, set all its child controls "Enabled" to false. I know i
can set them one by one. But there should be a easy way to do it
like :
for(int i=0;i<myUserControl.Controls.Count;i++)
{
control oControl = (control) myUserControl.Controls(i);
oControl.Enabled = false;
}
Anyone can give me a hint?
ElaineOn May 23, 9:01 pm, elaine <elain...@.gmail.com> wrote:
> But there should be a easy way to do it
> like :
> for(int i=0;i<myUserControl.Controls.Count;i++)
> {
> control oControl = (control) myUserControl.Controls(i);
> oControl.Enabled = false;
> }
> Anyone can give me a hint?
Sorry, I'm not clear on your question...
..do you mean that the for loop you wrote up there doesn't work ?
If it does, that seems fairly simple to me.. maybe I'd try to save a
line with:
foreach(Control ctrl in this.Controls)
ctrl.Enabled=false;
However, I don't think that the base Control class defines an Enabled
property, and that might be a problem. Then again, a Control might be
a label, a text literal, a generic html control, a bunch of things
were it's not quite clear what it means to be 'enabled' or not. Maybe
when 'enabled' is turned to false on your user control, you just don't
want to display any of its children controls ?
If so, at render time, you could check the value of the user control's
Enabled property:
if(this.Enabled)
base.Render(writer);
HTH,
~O
You could use control tree recursion to touch all the controls in the way
you describe.
Here are the details:
http://SteveOrr.net/faq/ControlTreeRecursion.aspx
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"elaine" <elain.sun@.gmail.com> wrote in message
news:1179968508.834610.110610@.n15g2000prd.googlegroups.com...
> Hi,
> I have a usercontrol which contains multiple server controls like
> textbox, radiobutton..., I have a public field in the usercontrol
> "Enabled". What i want to do is when the usercontrol's "Enabled" is
> set to false, set all its child controls "Enabled" to false. I know i
> can set them one by one. But there should be a easy way to do it
> like :
> for(int i=0;i<myUserControl.Controls.Count;i++)
> {
> control oControl = (control) myUserControl.Controls(i);
> oControl.Enabled = false;
> }
> Anyone can give me a hint?
> Elaine
>

Set Enabled to false for multiple web controls

Hi,

I have a usercontrol which contains multiple server controls like
textbox, radiobutton..., I have a public field in the usercontrol
"Enabled". What i want to do is when the usercontrol's "Enabled" is
set to false, set all its child controls "Enabled" to false. I know i
can set them one by one. But there should be a easy way to do it
like :

for(int i=0;i<myUserControl.Controls.Count;i++)
{
control oControl = (control) myUserControl.Controls(i);
oControl.Enabled = false;
}

Anyone can give me a hint?

ElaineOn May 23, 9:01 pm, elaine <elain...@.gmail.comwrote:

Quote:

Originally Posted by

But there should be a easy way to do it
like :
>
for(int i=0;i<myUserControl.Controls.Count;i++)
{
control oControl = (control) myUserControl.Controls(i);
oControl.Enabled = false;
>
}
>
Anyone can give me a hint?


Sorry, I'm not clear on your question...
...do you mean that the for loop you wrote up there doesn't work ?
If it does, that seems fairly simple to me.. maybe I'd try to save a
line with:

foreach(Control ctrl in this.Controls)
ctrl.Enabled=false;

However, I don't think that the base Control class defines an Enabled
property, and that might be a problem. Then again, a Control might be
a label, a text literal, a generic html control, a bunch of things
were it's not quite clear what it means to be 'enabled' or not. Maybe
when 'enabled' is turned to false on your user control, you just don't
want to display any of its children controls ?
If so, at render time, you could check the value of the user control's
Enabled property:

if(this.Enabled)
base.Render(writer);

HTH,
~O
You could use control tree recursion to touch all the controls in the way
you describe.
Here are the details:
http://SteveOrr.net/faq/ControlTreeRecursion.aspx
--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"elaine" <elain.sun@.gmail.comwrote in message
news:1179968508.834610.110610@.n15g2000prd.googlegr oups.com...

Quote:

Originally Posted by

Hi,
>
I have a usercontrol which contains multiple server controls like
textbox, radiobutton..., I have a public field in the usercontrol
"Enabled". What i want to do is when the usercontrol's "Enabled" is
set to false, set all its child controls "Enabled" to false. I know i
can set them one by one. But there should be a easy way to do it
like :
>
for(int i=0;i<myUserControl.Controls.Count;i++)
{
control oControl = (control) myUserControl.Controls(i);
oControl.Enabled = false;
}
>
Anyone can give me a hint?
>
Elaine
>