This is a migrated thread and some comments may be shown as answers.

Using 3 Radio buttons in a Radgrid (Have to click radio buttons twice in order to activate them)

4 Answers 181 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Adi
Top achievements
Rank 1
Adi asked on 26 Jul 2010, 01:48 PM
Hi All,

I am using 3 generic radio buttons in a dynamically increasing radgrid. I have put the radio buttons in a cell template as below. However in order to activate the radio buttons, I have to click them twice. Initially, I thought it was happening because I do not set their group names. However, even after setting their group names (Unique per row) in a  rowloaded event (I also tried binding groupnames to a unique row value) , I still have to click them twice inorder to activate them. For eg. if I have R1 R2 R3, and R1 is initially active, clicking R3 will first clear R1 and clicking it second time will select R3. However, I expect the behavior to be a single click ( clear R1 and select R3 in the same click). Please let me know if anybody knows how to get around this or has faced this issue earlier?


  <telerikGrid:GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <RadioButton Margin="4" x:Name="A" IsChecked="{Binding Path=StatusFlag, Converter={StaticResource AcceptRadioButtonCheckedConverter}, Mode=TwoWay}"
                                                 IsThreeState="False">
                                        <TextBlock Text="Accept"/>
                                    </RadioButton>
                                    <RadioButton Margin="4" x:Name="D" IsChecked="{Binding Path=StatusFlag, Converter={StaticResource DeferRadioButtonCheckedConverter}, Mode=TwoWay}"
                                                 IsThreeState="False">
                                        <TextBlock Text="Defer"/>
                                    </RadioButton>
                                    <RadioButton Margin="4" x:Name="R" IsChecked="{Binding Path=StatusFlag, Converter={StaticResource DeleteRadioButtonCheckedConverter}, Mode=TwoWay}"
                                                 IsThreeState="False">
                                        <TextBlock Text="Decline"/>
                                    </RadioButton>
                                </StackPanel>
                            </DataTemplate>
                        </telerikGrid:GridViewColumn.CellTemplate>

--Adi

4 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 29 Jul 2010, 07:35 AM
Hello Aadit,

I have tried to reproduce the issue using the code-snippet you sent, but unfortunately I could not and every single click on a radio button leads to change in the state of both the current button and the newly selected one. So, I would need more details about your project, about the converter you are using and the type of data you are loading as an ItemsSource for the grid.
 

Regards,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Adi
Top achievements
Rank 1
answered on 30 Jul 2010, 07:28 PM
Hey Maya,

Indeed there was a mistake in one of the converters I was using, I corrected that and it works as desired. Thanks a lot for pointing that out.

-Adi
0
namratha
Top achievements
Rank 2
answered on 06 Dec 2010, 08:19 AM
Hi i am using rad grid when i click radio button (select) in particular row
i should display value in text box from database in text box depending on row selected
0
Maya
Telerik team
answered on 06 Dec 2010, 08:27 AM
Hello namratha,

You may take advantage of the ParentOfType<> extension method and once a radio button is clicked, you can find its parent row and the necessary information for it.
 

All the best,
Maya
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
Tags
GridView
Asked by
Adi
Top achievements
Rank 1
Answers by
Maya
Telerik team
Adi
Top achievements
Rank 1
namratha
Top achievements
Rank 2
Share this question
or