Enable RadButton whe a colum is checked on a RadGridView

2 posts, 0 answers
  1. Hola
    Hola avatar
    3 posts
    Member since:
    Nov 2011

    Posted 24 Nov 2011 Link to this post

    Hello.

    I am trying to enable a Buttom when somebody check a column on a RadGridView ...

    it is the classic example of delete row ... I want to enable the delete buttom when somebody check at least one row in the grid.

    Here is my code:

    <telerik:RadButton Margin="2" Name="deleteApplicationButton" Click="deleteApplicationButton_Click" IsEnabled="False">
                               <Image Source="component/Resources/tool_bar_delete.png" Stretch="None" ToolTipService.ToolTip="New Application" />
                           </telerik:RadButton>
                       <telerik:RadGridView Grid.Row="1"                                         
                                            CanUserFreezeColumns="False"
                                            ShowGroupPanel="False"
                                            ItemsSource="{Binding Path=Applications, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 
                                            AutoGenerateColumns="False"                                          
                                            SelectionChanged="RadGridView_SelectionChanged"                                          
                                            Name="RadGridViewApplication" 
                                            IsSynchronizedWithCurrentItem="True" 
                                            CellEditEnded="RadGridViewApplication_CellEditEnded">                       
                           <telerik:RadGridView.Columns>
                               <telerik:GridViewCheckBoxColumn Header="Delete" DataMemberBinding="{Binding Path=IsChecked}"></telerik:GridViewCheckBoxColumn>
                              <!-- <telerik:GridViewDataColumn Header="Disable" DataMemberBinding="{Binding Path=Disable}" /> -->
                               <telerik:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Path=Key}"  IsReadOnly="True" />
                               <telerik:GridViewDataColumn Header="Description" DataMemberBinding="{Binding Path=Description}" Width="*" IsReadOnly="False" />
                               <telerik:GridViewDataColumn IsVisible="False" Header="GUID" DataMemberBinding="{Binding Path=GUID}" Width="*" IsReadOnly="False" />                            
                           </telerik:RadGridView.Columns>

    Please, how can I do it ... Could anybody provide a simple example?

    Thanks a lot
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 29 Nov 2011 Link to this post

    Hi Hola,

     Please check out the attached project where a basic approach is realized. Feel free to ask if you need further assistance. 

    Best wishes,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

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