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

Checkbox in RadTreelistview is not working properly.

7 Answers 177 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Kumar
Top achievements
Rank 1
Kumar asked on 05 Apr 2011, 02:35 PM
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

7 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 05 Apr 2011, 02:43 PM
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
0
Kumar
Top achievements
Rank 1
answered on 05 Apr 2011, 02:51 PM
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
0
Vanya Pavlova
Telerik team
answered on 05 Apr 2011, 03:41 PM
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
0
Kumar
Top achievements
Rank 1
answered on 06 Apr 2011, 08:14 AM
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..

0
Vanya Pavlova
Telerik team
answered on 06 Apr 2011, 08:33 AM
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
0
Sreekanth
Top achievements
Rank 1
answered on 06 Apr 2011, 12:31 PM
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...


0
Vanya Pavlova
Telerik team
answered on 07 Apr 2011, 09:15 AM
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
Tags
TreeListView
Asked by
Kumar
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Kumar
Top achievements
Rank 1
Sreekanth
Top achievements
Rank 1
Share this question
or