Checkbox in RadTreelistview is not working properly.

8 posts, 0 answers
  1. Kumar
    Kumar avatar
    46 posts
    Member since:
    Sep 2010

    Posted 05 Apr 2011 Link to this post

    Hi,

    I am using Checkbox in RadTreelistview and when i click this checkbox the check/uncheck operation is not performing.

    PN:Checkbox in RadTreelistview taking 3 mosue clicks to check .

    Please help
  2. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 05 Apr 2011 Link to this post

    Hello Kumar,

     


    May you please elaborate your problem in more details? Are you using the built-in GridViewCheckBox column or you have defined the CellTemplate for a particular GridViewDataColumn?
    I believe that the following online help article would be helpful on that matter, please follow this link. 



    Regards,
    Vanya Pavlova
    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. Kumar
    Kumar avatar
    46 posts
    Member since:
    Sep 2010

    Posted 05 Apr 2011 Link to this post

    Hi,

    Please find the below code how i am using RadTreeListView


      <RadTreeListView  x:Name="FrameworkPermissions"
                                      ItemsSource="{Binding Path=RolePermissionsList, Mode=TwoWay}"
                                      IsReadOnly="False"
                                      AutoGenerateColumns="False"
                                      Loaded="FrameworkPermissions_Loaded"
                                      CanUserFreezeColumns="False" IsFilteringAllowed="False" GridLinesVisibility="Both"
                                      ShowGroupPanel="False"
                                      AllowDrop="False" RowLoaded="FrameworkPermissions_RowLoaded">
                                        <RadgTreeListView.ChildTableDefinitions>
                                            <RadTreeListViewTableDefinition ItemsSource="{Binding Children}" />
                                        </RadTreeListView.ChildTableDefinitions>
                                    </RadTreeListView>

    In the FrameworkPermissions_RowLoaded method i am adding datacoloums as follows

    GridViewDataColumn tempDataColumn = new GridViewDataColumn();


                     tempDataColumn = new GridViewDataColumn()
                     {
                         UniqueName = "Task",
                         DataMemberBinding = new Binding("TaskName") { Mode = BindingMode.TwoWay }
                         ,
                         Width = 200
                     };


    Plz Help
  5. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 05 Apr 2011 Link to this post

    Hello Kumar,

     

    Thank you for sharing this snippet to us!
    Generally it is not a good idea to define columns in RowLoaded event since it is being fired each time the row appears in the view port. More appropriate would be to subscribe to the RadTreeListView's DataLoaded event and create the column there and specify the CellTemplate as it was described in the previously referenced help article.
    Please refer to the snippets below:


    MainWindow.xaml

    <Grid x:Name="LayoutRoot" DataContext="{Binding Source={StaticResource SampleDataSource}}">
        <Grid.Resources>
            <DataTemplate x:Key="dt">
           <CheckBox IsChecked="{Binding TaskName, Mode=TwoWay}" telerik:StyleManager.Theme="Office_Black"/>
       </DataTemplate>
            </Grid.Resources>
        <telerik:RadTreeListView ItemsSource="{Binding Collection}" DataLoaded="FrameworkPermissions_DataLoaded" x:Name="FrameworkPermissions" Margin="88,40,232,154" RowLoaded="FrameworkPermissions_RowLoaded">
              <telerik:RadTreeListView.ChildTableDefinitions>
                                        <telerik:TreeListViewTableDefinition ItemsSource="{Binding Collection}" />
                                    </telerik:RadTreeListView.ChildTableDefinitions>
            </telerik:RadTreeListView>
    </Grid>

    MainWindow.xaml.cs

    private void FrameworkPermissions_DataLoaded(object sender, EventArgs e)
         {
             GridViewDataColumn tempDataColumn = new GridViewDataColumn();
             tempDataColumn.Header = "Task";
             tempDataColumn.EditTriggers = GridViewEditTriggers.CellClick;
             tempDataColumn.DataMemberBinding = new Binding("TaskName") { Mode = BindingMode.TwoWay };
             tempDataColumn.CellTemplate = this.Resources["dt"] as DataTemplate;
             ...
     
         }



    Please let me know how this corresponds to your custom scenario.


    Greetings,
    Vanya Pavlova
    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
  6. Kumar
    Kumar avatar
    46 posts
    Member since:
    Sep 2010

    Posted 06 Apr 2011 Link to this post

    Hi Vanya,

    Thanks for the reply!

    I tried with the solution that you have given,after setting EditTriggers Property to the GridViewDataColumn ,the check box is taking two  Mouse clicks to check.Is there any otheway to check the CheckBox in a single Mouse Click.

    Please help..

  7. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 06 Apr 2011 Link to this post

    Hi Kumar,

     
    I strongly recommend you to review our online documentation that describes the RadGridView Event's lifecycle, please follow this link. Also you may find attached sample project that demonstrates the best approach to dynamically added columns. 


    I am waiting to hearing from you.


    Regards,
    Vanya Pavlova
    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
  8. Sreekanth
    Sreekanth avatar
    9 posts
    Member since:
    Apr 2011

    Posted 06 Apr 2011 Link to this post

    Hi Vanya,

    Thanks for the reply!

    I have written the code same as you wrote in your sample project.From your reply What i got to know is

    1.To Check the ChekBox in a Cell ,it will take two mouse clicks 1 is to make cell editable  another click is  to check the check box.
    2. If we check the parent row the child rows of the parent will not be selected/checked.

    Is there anyway to select the all child rows by selecting a parent row.

    Please Help...


  9. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 07 Apr 2011 Link to this post

    Hello Sreekanth,

     

    Yes, you are correct. Due to the Selection you may use the built-in GridViewSelectColumn which you can add dynamically as it was demonstrated in my last project, however it will select only the parent node, not the children nodes in RadTreeListView. Furthermore selecting the children of a particular node through selecting it is not supported out of the box and you need to implement it on your own. I believe that the following forum thread would be helpful on that matter. 
     

    Regards,
    Vanya Pavlova
    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
Back to Top
UI for WPF is Visual Studio 2017 Ready