GridViewDataColumn and using RadioButtons in a row

2 posts, 0 answers
  1. Jim
    Jim avatar
    11 posts
    Member since:
    Feb 2011

    Posted 10 Aug 2015 Link to this post

    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>

  2. Jim
    Jim avatar
    11 posts
    Member since:
    Feb 2011

    Posted 10 Aug 2015 in reply to Jim Link to this post

    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

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top