Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - CheckBox groups

 
 
Old 02-04-2006   #1 (permalink)
Erno


 
 

CheckBox groups

In a usercontrol I created a toolbar with some checkboxes grouped by setting
a GroupName. everything works fine.
But when I use multiple instances of the usercontrol the group extends
across the usercontrols.

How do I put these checkboxes in distinct groups without writing some code
that renames these groups on the fly...

Thanks,

Erno
----
WPF tutorials: http://blogs.infosupport.com/ernow/articles/1878.aspx





My System SpecsSystem Spec
Old 02-05-2006   #2 (permalink)
Erno


 
 

Re: CheckBox groups

Arg! Should be RadioButtons of course...

Still, same problem...

Erno
----
WPF tutorials: http://blogs.infosupport.com/ernow/articles/1878.aspx



"Erno" <nospam> wrote in message
news:%23zfhR3OKGHA.1288@TK2MSFTNGP09.phx.gbl...
> In a usercontrol I created a toolbar with some checkboxes grouped by
> setting a GroupName. everything works fine.
> But when I use multiple instances of the usercontrol the group extends
> across the usercontrols.
>
> How do I put these checkboxes in distinct groups without writing some code
> that renames these groups on the fly...
>
> Thanks,
>
> Erno
> ----
> WPF tutorials: http://blogs.infosupport.com/ernow/articles/1878.aspx
>
>
>
>



My System SpecsSystem Spec
Old 02-05-2006   #3 (permalink)
Erno


 
 

Re: CheckBox groups

I 'solved' it like this (but don't like it):

void Viewer_Loaded(object sender, RoutedEventArgs e)
{
if (this.Name != string.Empty)
{
foreach (object ctrl in tb.Items)
{
RadioButton r = ctrl as RadioButton;
if (r != null && r.GroupName != string.Empty)
{
r.GroupName = this.Name + ":" + r.GroupName;
}
}
}
}

tb is the toolbar.

This all depends heavily at having named the usercontrol...

Surely there is another way...

Erno
----
WPF tutorials: http://blogs.infosupport.com/ernow/articles/1878.aspx



"Erno" <nospam> wrote in message
news:%23zfhR3OKGHA.1288@TK2MSFTNGP09.phx.gbl...
> In a usercontrol I created a toolbar with some checkboxes grouped by
> setting a GroupName. everything works fine.
> But when I use multiple instances of the usercontrol the group extends
> across the usercontrols.
>
> How do I put these checkboxes in distinct groups without writing some code
> that renames these groups on the fly...
>
> Thanks,
>
> Erno
> ----
> WPF tutorials: http://blogs.infosupport.com/ernow/articles/1878.aspx
>
>
>
>



My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
databinding to 3-state checkbox? .NET General
Welcome Center - can't get rid of it (checkbox is missing!) Vista installation & setup
Welcome Center - can't get rid of it (checkbox is missing!) Vista General
Checkbox to never see this pop-up again. Vista account administration


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46