Hello,
I want to disable the scrollbars of a radTreeView. Could you please help me to do this. I have already tried to set to false the Visible and/or the Enable properties of VerticalScroll and/or HScrollBar, but the scrollbars are still visible.
Thanks.
Best regards,
Michael
I want to disable the scrollbars of a radTreeView. Could you please help me to do this. I have already tried to set to false the Visible and/or the Enable properties of VerticalScroll and/or HScrollBar, but the scrollbars are still visible.
Thanks.
Best regards,
Michael
4 Answers, 1 is accepted
0
Accepted
Hello Michael,
That is because the visibility of the scrollbars in RadTreeView is updated on layout.
You could handle the VisibleChanged event of the scrollbars and in the handler set the visibility to false like:
Hope this helps.
Best wishes,
Jordan
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
That is because the visibility of the scrollbars in RadTreeView is updated on layout.
You could handle the VisibleChanged event of the scrollbars and in the handler set the visibility to false like:
public Form1() |
{ |
InitializeComponent(); |
this.radTreeView1.HScrollBar.VisibleChanged += new EventHandler(HScrollBar_VisibleChanged); |
} |
void HScrollBar_VisibleChanged(object sender, EventArgs e) |
{ |
this.radTreeView1.HScrollBar.Visible = false; |
} |
Hope this helps.
Best wishes,
Jordan
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Michael
Top achievements
Rank 1
answered on 08 Aug 2008, 03:08 PM
This is working fine,
thanks a lot !
Michael
thanks a lot !
Michael
0
Berkant Oral
Top achievements
Rank 1
answered on 15 Aug 2012, 08:16 AM
I am using version 2012.2.726.40 and this.radTreeView1.HScrollBar doesn't have an event called VisibleChanged . How can i do this?
0
Hello Berkant Oral,
Thank you for writing.
To hide the horizontal scrollbar, you need to subscribe to the RadPropertyChanged event of the HScrollBar and set the Visibility property to collapsed. Here is a sample snippet:
Attached is a sample project that demonstrates the above snippet.
I hope you find my answer useful. Let me know if you have further queries.
Kind regards,
Boryana
the Telerik team
Thank you for writing.
To hide the horizontal scrollbar, you need to subscribe to the RadPropertyChanged event of the HScrollBar and set the Visibility property to collapsed. Here is a sample snippet:
public
partial
class
Form1 : Form
{
public
Form1()
{
InitializeComponent();
this
.radTreeView1.HScrollBar.Visibility = ElementVisibility.Collapsed;
this
.radTreeView1.HScrollBar.RadPropertyChanged +=
new
RadPropertyChangedEventHandler(HScrollBar_RadPropertyChanged);
}
void
HScrollBar_RadPropertyChanged(
object
sender, RadPropertyChangedEventArgs e)
{
if
(e.Property == RadItem.VisibilityProperty)
{
this
.radTreeView1.HScrollBar.Visibility = ElementVisibility.Collapsed;
}
}
}
Attached is a sample project that demonstrates the above snippet.
I hope you find my answer useful. Let me know if you have further queries.
Kind regards,
Boryana
the Telerik team