Scroll event not firing?

6 posts, 0 answers
  1. Marek
    Marek avatar
    48 posts
    Member since:
    Aug 2005

    Posted 03 Jul 2007 Link to this post

    Someone has probably already reported this one, but the Scroll event does not seem to be getting fired.

    Best regards

    Marek
  2. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 04 Jul 2007 Link to this post

    Hi Marek,

    We currently do not have a built in support of the Scroll event in RadTreeView.

    RadTreeView is a successor of RadControl, which in turn is a successor of ScrollableControl. The Scroll event comes from ScrollableControl's API.

    Nevertheless, I could suggest the following workaround:

    (this.radTreeView1.Controls[0] as RadScrollBar).Scroll += new ScrollEventHandler(Form1_Scroll); 
    (this.radTreeView1.Controls[1] as RadScrollBar).Scroll += new ScrollEventHandler(Form1_Scroll); 

     
    That code will subscribe to the Scroll events of RadTreeViews' scrollbars. The first child is the vertical scrollbar and the second is the horizontal scrollbar. We are going to implement that behavior in the Q2 release of RadControls for WinForms.

    I hope that helps.
     

    Regards,
    Ray
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Marek
    Marek avatar
    48 posts
    Member since:
    Aug 2005

    Posted 05 Jul 2007 Link to this post

    Hi Ray
    Thanks for the response.  It certainly moves me forward.  One point though.  In my implementation I had to use 

    (this.radTreeView1.Controls[1] as RadScrollBar).Scroll += new ScrollEventHandler(Form1_Scroll); 
    (this.radTreeView1.Controls[2] as RadScrollBar).Scroll += new ScrollEventHandler(Form1_Scroll); 
    as this.radTreeView1.Controls[0] was an edit control (?).

    I have another question (sorry) along these lines, which relates to the RadTreeNode LabelBounds property.  We have two RadTreeView controls and draw lines between them to indicate a connection.  Would you expect the LabelBounds property to change when the parent RadTreeView is scrolled? 

    Thanks again.

    Marek
  4. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 05 Jul 2007 Link to this post


    Indeed, Marek, if you have editors or other controls added/inserted to your treeView, the indexes of the scrollers would be different, i.e you could iterate through your controls collection and check their type to see if the control is a scrollbar. 

    The LabelBounds property is not expected to change while scrolling. This is by design. It is re-calculated when you collapse, expand, remove, add, and insert nodes, but not in the case of scrolling.

    In order to help you, it would be best to give us information on your exact scenario.


    All the best,
    Ray
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. Marek
    Marek avatar
    48 posts
    Member since:
    Aug 2005

    Posted 05 Jul 2007 Link to this post

    Hi Ray
    That's great.  As long as I know that the LabelBounds property will not change (by design) then I am happy to code against that.  I was just worried that you might change this in the future and my implementation would be broken.  Another third party tree does update the node item bounds.

    Thanks for the excellent support (yet again)

    Marek
  6. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 06 Jul 2007 Link to this post

    Thank you for the nice words, Marek, we are glad to have helped.

    The only thing we may change is the name of the LabelBounds property to Bounds. Of course, we will mark it as obsolete before removing it, so that you can update your application before the change.

    If you need further assistance with your issues, please write us back.
     

    Best wishes,
    Ray
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top