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

edit mode - MANY BUGS?

1 Answer 14 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
tomas
Top achievements
Rank 1
tomas asked on 08 Nov 2012, 02:58 PM
Hi Telerik,
Please try this:

Create collection of objects with two required properties and parentchild hierarchy.

Add 3rd property - IsInEditMode. Bind that property to your object MODE = TWOWAY. Create datatemplates with a form and 2 textboxes to update object properties.

Start an edit of one node. Your form with two textboxes should be visible. Click somewhere in the form but not in the textboxes.

Your setter for the IsInEditMode should look like this:

if (this.isInEditMode != value)
                {
                     
                    this.isInEditMode = value;
                    if (this.HasErrors)
                        this.isInEditMode = true;
                    this.NotifyPropertyChanged("IsInEditMode");
                }

When there are some validation errors, you will get not edited node (treeview item) but IsInEditMode will have a value = true.

I cannot post my solution because it is too big, but you can simulate this easily.


Another bug is that the previewEdited event can NOTbe canceled. Edit mode is always terminated.

Thank you.

Tom

1 Answer, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 13 Nov 2012, 03:44 PM
Hi Tom,

Let me make a quick clarification. The internal logic of the RadTreeView control does not support keeping the EditMode through property bindings. However, you can keep the edit mode through events. If you handle the EditCancled (it is fired when the edited item looses focus or the escape key is pressed) and the PreviewEdited (it is fired when you press the enter key) events, the ItemEditTemplate will remain applied to the RadTreeViewItem.

Regards,
Pavel R. Pavlov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
TreeView
Asked by
tomas
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Share this question
or