Skip to main content
Home Forums Silverlight Programming Programming with .NET - General How to change the ststus of radio buttons used in Listbox
2 replies. Latest Post by sajesh28l@gmail.com on August 17, 2008.
(0)
sajesh28...
Member
1 points
26 Posts
08-08-2008 12:04 AM |
Hi,
I want to use radio buttons in listbox.Now i can select multiple radio button at a time.But i need to select one radio button at a time.Can anybody help me to do this?
My xaml code
<ListBox Height="300" Width="200" ScrollViewer.VerticalScrollBarVisibility="Visible" FontFamily="Times New Roman" FontSize="14" x:Name="DetecList" Canvas.Top="25"> <ListBoxItem> <RadioButton Content="Account No" x:Name="chkaccnt" IsChecked="false" ClickMode="Release" Checked="chkaccnt_Checked"/> </ListBoxItem> <ListBoxItem> <RadioButton Content="Transaction Date" x:Name="chktransdate" IsChecked="false" ClickMode="Press" /> </ListBoxItem> <ListBoxItem> <RadioButton Content="Transaction Time" x:Name="chktranstime" IsChecked="false" ClickMode="Press" /> </ListBoxItem> <ListBoxItem> <RadioButton Content="Sequence No" x:Name="chkseqno" IsChecked="false" ClickMode="Press" /> </ListBoxItem> <ListBoxItem> <RadioButton Content="Debit/Credit Code" x:Name="chkdebit" IsChecked="false" ClickMode="Press" /> </ListBoxItem> <ListBoxItem> <RadioButton Content="Channel/Transaction Code" x:Name="chkchannelcode" IsChecked="false" ClickMode="Press" /> </ListBoxItem> <ListBoxItem> <RadioButton Content="Amount" x:Name="chkamount" IsChecked="false" ClickMode="Press"/> </ListBoxItem> </ListBox>
Thanks In advance
Regards,
Sajesh
HarshBar...
Star
9908 points
1,719 Posts
08-08-2008 4:54 AM |
You can definately do this.I tried your Code only and i added Group Name in that.Group Name must be Same for each Radio Button to make them mutually exclusive .I am posting That code.
If this Answers your Question mark it as answer.
08-17-2008 9:32 PM |
Hi Harsh,
Thanks for ur help.its working very well