Skip to main content

Microsoft Silverlight

Answered Question How to change the ststus of radio buttons used in ListboxRSS Feed

(0)

sajesh28l@gmail.com
sajesh28...

Member

Member

1 points

26 Posts

How to change the ststus of radio buttons used in Listbox

 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 

HarshBardhan
HarshBar...

Star

Star

9908 points

1,719 Posts

Answered Question

Re: How to change the ststus of radio buttons used in Listbox

Hi,

 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.

<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" GroupName="newGroup" /</ListBoxItem><ListBoxItem><RadioButton Content="Transaction Date" x:Name="chktransdate" IsChecked="false" ClickMode="Press" GroupName="newGroup" /></ListBoxItem></ListBox>

If this Answers your Question mark it as answer.

Mark as answer if this post answered your question.

Harsh Bardhan

sajesh28l@gmail.com
sajesh28...

Member

Member

1 points

26 Posts

Re: How to change the ststus of radio buttons used in Listbox

Hi Harsh,

 

 Thanks for ur help.its working very well

 

 

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities