This is the name of the post on the official telerik website. As I encountered this problem, I also solved it after reading the official reply. Not to mention the application scenarios and solutions.
Application Scenario: click a node in radtreeview to respond to the event. If the current node is in the selected status, the click still triggers the RESPONSE event.
(Original: I bound the radtreeviewitem. mouseleftbuttondown to an event handler in code, but in debug I noticed the event never fires. I didn't use the radtreeviewitem. selected event because when a item is selected, when use click the item again the selected event don't fire-this is not I want, so I have to handle the mouseleftbuttondown or up events... the two events never fire. help !)
Solution: The radtreeview selectionchanged event is usually used, but this time can only be triggered when the selected node is changed, in addition, setting isselected = true for a node will also be triggered (This point is inconvenient for locating the node, and selectionchanged will be triggered when setting isselected = true for the node after locating the node ), therefore, the selectionchanged event is not applicable in this scenario.
It is speechless to find that the mouseleftbuttondown event is not triggered in projects.
After reading the official telerik reply, we found that the official mouseleftbuttonup event was used to handle this scenario. Telerik does not explain why an up event is used instead of a down event. It is possible that telerik does not obtain the current node when implementing the control, but only obtains the node when the up event is implemented.
Code:
Private void treeviewroot_mouseleftbuttonup (Object sender, system. Windows. Input. mousebuttoneventargs E)
{
Objtreenodeclass onodeent = treeviewroot. selecteditem as objtreenodeclass;
If (null = onodeent)
{
Return;
}
// Processing logic
}
The processing method is really speechless. You can't use others' controls to follow others' rules, no matter how awkward others' rules are.