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

Scroll event not firing?

5 Answers 210 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Marek
Top achievements
Rank 1
Marek asked on 03 Jul 2007, 01:16 PM
Someone has probably already reported this one, but the Scroll event does not seem to be getting fired.

Best regards

Marek

5 Answers, 1 is accepted

Sort by
0
Boyko Markov
Telerik team
answered on 04 Jul 2007, 04:33 PM
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
0
Marek
Top achievements
Rank 1
answered on 05 Jul 2007, 07:22 AM
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
0
Boyko Markov
Telerik team
answered on 05 Jul 2007, 10:51 AM

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
0
Marek
Top achievements
Rank 1
answered on 05 Jul 2007, 12:01 PM
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
0
Boyko Markov
Telerik team
answered on 06 Jul 2007, 08:16 AM
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
Tags
Treeview
Asked by
Marek
Top achievements
Rank 1
Answers by
Boyko Markov
Telerik team
Marek
Top achievements
Rank 1
Share this question
or