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

GridViewDataColumn and using RadioButtons in a row

1 Answer 41 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jim
Top achievements
Rank 1
Jim asked on 10 Aug 2015, 03:45 PM

I have a grid view where in one column I need to have two radio buttons defined (yes and no), but If I try that I get an error about "The property "Visual Tree" can only be set once.".  What I'm wanting is for user to be able to change a selection for that row if he makes a mistake.  I'm rather new at all of this so I might be going about this the wrong way, just using examples I've found and trying to piece together something to work.

Thanks,

-- Jim

 

<telerik:GridViewDataColumn Header="Products Coverage"  DataMemberBinding="{Binding UnderwritingFactor}">              

          <telerik:GridViewDataColumn.CellTemplate>                                                             

             <DataTemplate>                <RadioButton GroupName="ProductsCoverage" Content="Yes" IsChecked="{Binding PropertyLiability.HasProductsCoverage, Mode=TwoWay}"  IsEnabled="{Binding PropertyLiability.HasFarmLiability, Mode=OneWay}"/>                <RadioButton GroupName="ProductsCoverage" Margin="5, 0, 0, 0" Content="No" IsChecked="{Binding PropertyLiability.HasEProductsCoverage, Converter={StaticResource BoolInverseConverter}, Mode=TwoWay}" IsEnabled="{Binding PropertyLiability.HasFarmLiability, Mode=OneWay}"/>                                                             

           </DataTemplate>       

       </telerik:GridViewDataColumn.CellTemplate>                                                        

 </telerik:GridViewDataColumn>

1 Answer, 1 is accepted

Sort by
0
Jim
Top achievements
Rank 1
answered on 10 Aug 2015, 06:33 PM

I think I figured it out.  I put a StackPanel around the buttons and that worked.  I had tried that before but obviously had something else that was interfering and told me I couldn't use a StackPanel there.

-- Jim

Tags
GridView
Asked by
Jim
Top achievements
Rank 1
Answers by
Jim
Top achievements
Rank 1
Share this question
or