double clicking on elements queues events

10 posts, 0 answers
  1. Mariano
    Mariano avatar
    8 posts
    Member since:
    Aug 2010

    Posted 21 Feb 2011 Link to this post

    When double clicking or more (n-clicking) on any radtreeview node, or radcontextmenuitem (at least, maybe it happens on other controls), the screen freezes for a few seconds, apparently cueing the events before even going to the event handler on the code behind. The result of this is that any action is repeated n-times.
    Any workaround or help will be great!
    Best Regards,

    Mariano Liceaga
  2. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 21 Feb 2011 Link to this post

    Hello Mariano,

    I haven't experienced this issue before. If you could post a small sample using the format code block that replicates the issue, in the RadTreeView for exmaple, I'll be happy to take a look at it for you
    thanks
    Richard
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Mariano
    Mariano avatar
    8 posts
    Member since:
    Aug 2010

    Posted 21 Feb 2011 Link to this post

    Richard,

    If I had the luxury of having time to develop custom samples isolated from the whole project to reproduce strange behaviours like this, I would certainly do it. But unfortunately I have to deliver the full working product end of this week, and it is absolutely impossible to spend time on trying to reproduce odd telerik behaviours. I already submitted a support ticket for this, but lately I have been getting almost useless answers from the support team.
    Thank you for your undestanding.
    Best Regards,

    Mariano Liceag
  5. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 21 Feb 2011 Link to this post

    Hello Mariano,

    I'm sure you will get an answer in your support ticket.
    If you would care to describe at least how you replicate the issue, I will try to help you, but without further information as to what you're doing, I'm unable to offer any advise.
    Thanks
    Richard
  6. Mariano
    Mariano avatar
    8 posts
    Member since:
    Aug 2010

    Posted 22 Feb 2011 Link to this post

    Richard,

    The scenario to reproduce would be to have 2 trees, both dynamically populated.
    The first one is a one level only tree populated one by one node in a for loop.
    The second one is a multilevel tree that contains different types of objects, populated by a recursive function.
    I´m pasting the most simple thing that I can make but as you can see it does not reproduce the behaviour of cueing the events either.....but it´s a starting point at least.
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using Telerik.WinControls;
    using Telerik.WinControls.UI;
     
    namespace myApp
    {
        public partial class Form1 : Form
        {
            private List<parent> Parents;
     
            public Form1()
            {
                InitializeComponent();
     
                InitDummyCollection();
                PopulateSimpleTree();
     
                radTreeView2.Nodes.Add(new RadTreeNode("Root"));
                radTreeView2.Nodes[0].Expand();
     
                radTreeView1.DragOverNode += new EventHandler<RadTreeViewDragCancelEventArgs>(radTreeView1_DragOverNode);
                radTreeView1.DragEnded += new RadTreeView.DragEndedHandler(radTreeView1_DragEnded);           
                 
     
     
                foreach(parent p in this.Parents)
                {           
                   PopulateNestedTree(radTreeView2.Nodes[0],p);               
                }          
            }
     
            void radTreeView1_DragEnded(object sender, RadTreeViewDragEventArgs e)
            {
                EnableAllNodes(radTreeView2.Nodes);
            }      
     
            void radTreeView1_DragOverNode(object sender, RadTreeViewDragCancelEventArgs e)
            {
                EnableAllNodes(radTreeView2.Nodes);
                PaintNodesService.PaintNode(e.TargetNode);
            }
     
            //Fills the collection
            private void InitDummyCollection()
            {
                List<child> Childs = new List<child>();
                this.Parents = new List<parent>();
     
                for (int i = 0; i < 5; i++)
                {
                    Childs.Add(new child("child" + i.ToString()));               
                }
     
                for (int j = 0; j < 3; j++)
                {
                    parent newParent = new parent("parent" + j.ToString(), Childs);
                    Parents.Add(newParent);
                }
            }
     
            //Populates the tree at the left
            private void PopulateSimpleTree()
            {
                radTreeView1.DragEnding += new RadTreeView.DragEndingHandler(radTreeView1_DragEnding);
     
                for (int i = 0; i < 10; i++)
                {
                    radTreeView1.Nodes.Add(new RadTreeNode("node" + i.ToString()));               
                }
            }
     
            //Populates the tree at the right
            private void PopulateNestedTree(RadTreeNode nodeParent, ICommon common)
            {
                if (common is parent)
                {             
                    parent p = (parent)common;
     
                    RadTreeNode node = new RadTreeNode(p.Name);
                    node.Expand();
                    nodeParent.Nodes.Add(node);
     
                    foreach(child c in p.Childs)
                    {
                        PopulateNestedTree(node, c);
                    }
                }
                else
                {
                    child c = (child)common;
                    RadTreeNode node = new RadTreeNode(c.Name);
                    nodeParent.Nodes.Add(node);
                }
            }
     
            //Unpaint all nodes
            private void EnableAllNodes(RadTreeNodeCollection nodes)
            {
                foreach (RadTreeNode node in nodes)
                {
                    node.Enabled = true;
                    PaintNodesService.UnpaintNode(node);
                    EnableAllNodes(node.Nodes);
                }
            }
     
            void radTreeView1_DragEnding(object sender, RadTreeViewDragCancelEventArgs e)
            {
                System.Threading.Thread.Sleep(5000);
            }
     
            private void radTreeView2_SelectedNodeChanged(object sender, RadTreeViewEventArgs e)
            {
     
            }
        }
    }
     
     
    namespace myApp
    {
        partial class Form1
        {
            /// <summary>
            /// Required designer variable.
            /// </summary>
            private System.ComponentModel.IContainer components = null;
     
            /// <summary>
            /// Clean up any resources being used.
            /// </summary>
            /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
            protected override void Dispose(bool disposing)
            {
                if (disposing && (components != null))
                {
                    components.Dispose();
                }
                base.Dispose(disposing);
            }
     
            #region Windows Form Designer generated code
     
            /// <summary>
            /// Required method for Designer support - do not modify
            /// the contents of this method with the code editor.
            /// </summary>
            private void InitializeComponent()
            {
                this.radTreeView1 = new Telerik.WinControls.UI.RadTreeView();
                this.radTreeView2 = new Telerik.WinControls.UI.RadTreeView();
                ((System.ComponentModel.ISupportInitialize)(this.radTreeView1)).BeginInit();
                ((System.ComponentModel.ISupportInitialize)(this.radTreeView2)).BeginInit();
                this.SuspendLayout();
                //
                // radTreeView1
                //
                this.radTreeView1.AllowDragDrop = true;
                this.radTreeView1.AllowDrop = true;
                this.radTreeView1.Location = new System.Drawing.Point(60, 30);
                this.radTreeView1.Name = "radTreeView1";
                this.radTreeView1.Size = new System.Drawing.Size(304, 380);
                this.radTreeView1.TabIndex = 0;
                this.radTreeView1.Text = "radTreeView1";
                this.radTreeView1.ThemeName = "ControlDefault";
                //
                // radTreeView2
                //
                this.radTreeView2.AllowDrop = true;
                this.radTreeView2.Location = new System.Drawing.Point(416, 39);
                this.radTreeView2.Name = "radTreeView2";
                this.radTreeView2.Size = new System.Drawing.Size(307, 371);
                this.radTreeView2.TabIndex = 1;
                this.radTreeView2.Text = "radTreeView2";
                this.radTreeView2.SelectedNodeChanged += new Telerik.WinControls.UI.RadTreeView.RadTreeViewEventHandler(this.radTreeView2_SelectedNodeChanged);
                //
                // Form1
                //
                this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
                this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
                this.ClientSize = new System.Drawing.Size(744, 466);
                this.Controls.Add(this.radTreeView2);
                this.Controls.Add(this.radTreeView1);
                this.Name = "Form1";
                this.Text = "Form1";
                ((System.ComponentModel.ISupportInitialize)(this.radTreeView1)).EndInit();
                ((System.ComponentModel.ISupportInitialize)(this.radTreeView2)).EndInit();
                this.ResumeLayout(false);
     
            }
     
            #endregion
     
            private Telerik.WinControls.UI.RadTreeView radTreeView1;
            private Telerik.WinControls.UI.RadTreeView radTreeView2;
        }
    }
     
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
     
    namespace myApp
    {
        public class child: ICommon
        {
            private string _name;
     
            public string Name
            {
                get
                {
                    return _name;
                }
                set
                {
                    _name = value;
                }
            }
     
            public child(string name)
            {
                this._name = name;
            }
        }
    }
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
     
    namespace myApp
    {
        public interface ICommon
        {
     
        }
    }
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
     
    namespace myApp
    {
        public class parent: ICommon
        {
            private string _name;
            private List<child> _listChilds;
     
            public string Name
            {
                get
                {
                    return _name;
                }
                set
                {
                    _name = value;
                }
            }
     
            public List<child> Childs
            {
                get
                {
                    return _listChilds;
                }
                set
                {
                    _listChilds = value;
                }
            }
     
            public parent(string name, List<child> listChilds)
            {
                this._name = name;
                this._listChilds = listChilds;
            }
        }
    }
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Drawing;
    using System.Data;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using Telerik.WinControls;
    using Telerik.WinControls.UI;
     
    namespace myApp
    {
        public static class PaintNodesService
        {
            public static void PaintNode(RadTreeNode node)
            {
                node.BackColor = Color.Orange;
                node.BackColor2 = Color.Orange;
            }
     
            public static void UnpaintNode(RadTreeNode node)
            {
                node.BackColor = Color.FromArgb(0, 0, 0, 0);
                node.BackColor2 = Color.Transparent;
            }
        }
    }

    Thank you for your undestanding and any help will be appreciated.
    Best Regards,
  7. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 22 Feb 2011 Link to this post

    Hello Mariano,

    Thanks for explaining. However, as you may have seen, you can't attach projects here, only code using the Format Code block.
    I had already tried to replicate your issue over the last day, but to no avail.

    From what I understand of your explanation, you're unable to reproduce this again either. Is that correct?
    If you can paste the sample into the format code area, I'll be happy to see if it produces it on my end.
    Thanks
    Richard
  8. Mariano
    Mariano avatar
    8 posts
    Member since:
    Aug 2010

    Posted 22 Feb 2011 Link to this post

    I pasted the code, but it does not reproduce the error. I think it must be something non trivial that happens only in the full application with all the overhead that the processing of real data produces, therefore cueing the events.
  9. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 22 Feb 2011 Link to this post

    Hello,

    Just a note to let you know that I've tried your sample, and like you, I couldn't replicate your issue. It sounds as though it is specific to your main application. It may confirm it if you can replicate the issue with your main application on another PC.
    Regards,
    Richard
  10. Mariano
    Mariano avatar
    8 posts
    Member since:
    Aug 2010

    Posted 22 Feb 2011 Link to this post

    It is specific as I´m able to reproduce it anywhere. However it is not something that I can´t fix, as I have already tried pretty much everything, and it keeps cueing the events after several clicks. And as you can imagine, I can´t post the whole app here...
    So it looks like a dead end to me.
  11. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 22 Feb 2011 Link to this post

    Hello,

    The only thing left to suggest as neither of us can re-produce this in a new project is to open a support ticket and send Telerik your full application. They will be able to sign an NDA is required.
    Regards,
    Richard
Back to Top
UI for WinForms is Visual Studio 2017 Ready