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

Set in editing mode from code-behind

4 Answers 81 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
sdupere
Top achievements
Rank 1
sdupere asked on 28 Dec 2009, 02:31 PM
Hello,

I'm looking for a way to put the treelistview control in editing mode from code-behind. More precisely, I need the selected line to be set to editable when the user clicks on a 'Modify' button on the form.

I know pressing F2 seems to set the editable mode on with the TreeView, but it doesn't work yet on the TreeListView?

Thank you

-Simon

4 Answers, 1 is accepted

Sort by
0
Miroslav
Telerik team
answered on 29 Dec 2009, 08:55 AM
Hello Simon,

Thank you for your interest in the TreeListView! Please note that the control is a CTP, so it may change in future versions.

This should put the currently selected item in edit mode:

if(treeList.SelectedContainer != null)
{
    treeList.SelectedContainer.BeginEdit();
}

To get the editing working, you need to set the IsEditable property on the TreeList and the same property on the column you want to be editable. In this version you need to specify a CellEditTemplate for the column explicitly.

Hopefully this will work for you,

Greetings,
Miroslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
VH
Top achievements
Rank 1
answered on 09 Mar 2010, 03:47 AM
Sorry, solved. my bad...
0
Ketaki
Top achievements
Rank 1
answered on 07 Apr 2010, 10:03 AM
Hi,

I am using tree control RadTreeListView, where isEditable is set to true in XAML file.

I want to enable/disable the property "isEditable" depending upon certain conditions.

for e.g. if the DTO object binded with tree contains "allow"(proeprty in DTO object) proeprty to "true", make "isEditable" to true otherwise dont allow user to edit the column/value.

Right now I am trying to set isEditable to false in code behind, but its not taking effect and always allows user to edit.

Is this possible? If yes, how to do it?

Help needed asap.

Thanks
Ketaki
0
Miroslav
Telerik team
answered on 08 Apr 2010, 09:09 AM
Hi Ketaki,

There is an IsEditable property on the TreeListViewItem. You can use container bindings to bind it to a property on your ViewModel and turn off/on editing for a particular row.

If you need fine-grained editing you can handle the PreviewEditStarted routed event of the item. Marking this event as handled (e.Handled = true) means that the editing will not start.

Please note that the TreeListView is a CTP and some major changes are expected for its next version as it will be based on the GridView rather than the TreeView. It is best no to base any production code on it yet.

Best wishes,
Miroslav
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
sdupere
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
VH
Top achievements
Rank 1
Ketaki
Top achievements
Rank 1
Share this question
or