I Have a problem with my application when I m trying to edit a radTreeViewItem. I use MVVM Pattern and I bind the radTreeViewItem's IsInEditMode with a boolean property of my business object. But sometimes the EditStart Event fires and a can Edit or sometimes the isinEditmode is set to true and EditStart event does not fire. In the latter case I lost the header and I can not edit.
I tried also not using the IsInEditMode property by using directly the BeginEdit() method on the RadTreeViewItem but also in that case sometimes i can edit sometimes not. I saw also in the wpf forum other people who have faced the same problem and i tried all suggested solutions without success.
Thank U for your help to overcome that problem
11 Answers, 1 is accepted
Could you please send us a runnable sample showing the issue ? This way we could investigate it in depth and provide you with a better suited solution or advice? Meanwhile you can examine this demo or this documentation article and check if you have missed something. You can also test your application with the dlls from Q1 2011 Beta or some of the latest internal builds and see if the problem is still reproducible. Thank you for your cooperation.
All the best,
Petar Mladenov
the Telerik team
Thanks u for your help. I solve partially the problem by setting directely the IsInEditMode property of RadTreeViewItem instead using binding. But the problem i faced is when I add a new item using a contextMenu of the radtreeView. I use the itemPrepared Event to set the IsInEditMode but the EditStarted event does not fire.
This the code I wrote for ItemPrepared Event:
private void favRadTreeView_ItemPrepared(object sender, RadTreeViewItemPreparedEventArgs e)
{
if (_OnCreating)
{
e.PreparedItem.IsInEditMode = true;
//e.PreparedItem.BeginEdit();
}
}
But even when i use BeginEdit() method there is no EditStarted event fired.
Another problem i saw, during the editing it's not to insert the space. The demo example here http://demos.telerik.com/silverlight/#TreeView/NodeEditing does not accept the space character when editing. Is there a way to include the space character when editing?
Thanks for your help.
Could you please elaborate more on your scenario, a sample project will be highly appreciated? It is very possible that the contextmenu steals the focus that the RadTreeViewItem needs in order to get into Edit Mode. On the other hand, the issue with the space key in edit mode is known and the fix for it will be included in the following internal build next week and SP1 13 scheduled for 13 April.
All the best,
Petar Mladenov
the Telerik team
I have created a project that shows this bug,
I will open a support ticket up for this:
Chad
Currently we are aware of two cases in which the edit mode is not working correctly:
1. The first case is when tree view item is put into edit mode and before the edit mode is completed another item is also put in edit mode. This case is generally achieved through code and calling the BeginEdit method. Usually the BeginEdit is called on a click of button placed inside the TreeViewItem template. This bug is already fixed and should not be occurring with the upcoming 2011 Q2 SP release dlls.
2. The second issue is generally described as: "Edit mode does not starts when fast clicks are performed over tree items". Actually this issue is cause by the drag and drop manager and its functionality. We are still investigating the cause and will try fix it as soon as possible. However, a workaround by setting the IsDragDropEnabled property to true could be used for the time being we fix this.
Hope this post is helpful for understanding and correctly determining which of the two cases you are having troubles with.
Finally, if your scenario is different from the ones described above, I would be please if you share it with us and provide a test project.
Regards,
Hristo
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>
Indeed I'm struggling with case 2. It seems by setting the following in the constructor:
TheTreeView.IsDragDropEnabled =
true
;
TheTreeView.IsDropPreviewLineEnabled =
false
;
TheTreeView.IsDragTooltipEnabled =
false
;
TheTreeView.PreviewDragEnded +=
new
RadTreeViewDragEndedEventHandler(TheTreeView_PreviewDragEnded);
TheTreeView.IsDragPreviewEnabled =
false
;
private
void
TheTreeView_PreviewDragEnded(
object
sender, RadTreeViewDragEndedEventArgs e)
{
e.Handled =
true
;
// This will cancel the drag operation.
}
When only setting IsDragDropEnabled and then cancelling the drag and drop operation in the PreviewDragStarted() event is not enough to get rid of the problem.
P.S. The IsDropPreviewLineEnabled property is not shown in the Properties Window (VS2010). But is suggested and can be entered in xaml directly.
We agree that your workaround is better if you don't want to use the DragAndDrop feature. On the other hand, we logged a bug in our PITS(TreeView: The IsDropPreviewLineEnabled property is not shown in the Properties Window) and we also updated your telerik account points as a thanks for your cooperation.
Greetings,Petar Mladenov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
We want to inform you that this issue is fixed in our latest official 2012 Q1 release.
It will be great if you can give it a try and let us know if it works for you.
On a separate note, I'd like to let you know that there are 5 brand new controls that we included in this release:
- Diagrams (Beta)
- GanttView (CTP)
- TimeLine
- ListBox (Beta)
- DataBar
When you have time, you can give them a try as we will highly appreciate your feedback.
Greetings,
Vladislav
the Telerik team
I am currently using the telerik controls for silverlight version 2011.2.712.1040.
In this version, in RadTreeView i am facing the same issue as discussed in this post.
Sometimes the Edit started event does not fire when i try to rename an item. It is not very consistent and i am not able to find out why this happens.
Kindly provide a solution for this issue as we are not planning to migrate the telerik version.
Thanks
Farheen
What logic do you need to perform on EditStarted ? Or the Item does not go into edit mode at all ?
If you bind the IsInEditMode to boolean property from our ViewModels, you can use the setter or the property instead of the event.
On a side note, we highly encourage you to upgrade because the version you use is almost 4 years ago and you may also hit other issues that are fixed in newer versions. Additionaly, you will be able to take advantage of all new features and new controls in our latest release compared to the release in 2011.
Regards,
Petar Mladenov
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.