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

Set treeview scrollbars theme to default windows based?

8 Answers 146 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Hassan
Top achievements
Rank 1
Hassan asked on 17 Jan 2009, 11:10 AM
Hi,

I am using a RadTreeView and a webbrowser (System.Windows.Forms.Webbrowser) on a form, the problem is that i need to set the themes of both control's scrollbars similar. Is there any way to set the treeview's scrollbars theme to system theme (which windows is currently using). And what is the probability of you to add a web browser control in Telerik suite.  

Thanks and regards

Hassan

8 Answers, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 19 Jan 2009, 05:27 PM
Hello Hassan,

Thank you for writing.
You can modify the appearance of the scrollbar to your liking by creating a custom theme that modifies only the scrollbars with the Visual Style Builder tool. Here are two links to the VSB documentation and video tutorials respectively:
http://www.telerik.com/help/winforms/vsb_overview.html
http://tv.telerik.com/home
On the second link, click on the WinForms tab and check out the VisualStyleBuilder related videos.
Let us know if you need assistance with this task.

As for the WebBrowser control, we will not be including one in our control suite at least for now. Nevertheless you can customize the scrollbars of the WebBrowser control by embedding custom CSS rules within the rendered HTML document. Please let us know if you are interested by the approach.

I hope we have been helpful. Please write back if you have more questions.

Greetings,
Victor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Hassan
Top achievements
Rank 1
answered on 20 Jan 2009, 12:24 PM
Hi,

Thanks for your reply but can you provide more help regarding changing theme in VSB for treeview scrollbar

Regards,

Hassan
0
Victor
Telerik team
answered on 21 Jan 2009, 10:05 AM
Hi Hassan,

Thanks for writing.

There are few specific things that you need to do.

Firstly you need to create a theme for the RadVScrollBar or RadHScrollBar depending on how you need to scroll. Load the RadHScrollBar or RadVScrollBar and change its appearance. An important thing to do is to give this new theme a name. You can do that by typing the name in the text box on the menu bar(upper right corner of Visual Style Builder). Please see the screenshot if you are unsure about that.

Secondly you need to create a theme for the RadTreeView. You just need to save an existing theme with the same name as the RadScrollBar theme. For example, if you have named the RadScrollBar theme "ScrollTheme" you need to name the RadTreeView theme "ScrollTheme" too. This is really important - the names need to be the same.

The third step consists of adding the newly created xml files to your project, setting their Copy to Output Directory property to Copy if newer, and finally adding these two lines of code before the InitializeComponent() method invocation in your Form constructor.

ThemeResolutionService.RegisterThemeFromStorage(ThemeStorageType.File, "~\\TreeTheme.xml");  
ThemeResolutionService.RegisterThemeFromStorage(ThemeStorageType.File, "~\\ScrollTheme.xml");

 

Also do not forget to replace the file names for the second argument with your actual file names.

I hope this proves helpful and encourage you to write again if you have other questions.

Kind regards,
Victor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Hassan
Top achievements
Rank 1
answered on 21 Jan 2009, 11:06 AM
Hi,

I really appreciate your answer and i am going to try it, currently I have a question related to the same thread that is:

I have an idea of using RadScroolbar with web browser control, i have tried but unsuccessful. Can you please help me on this regard as from this way I can achieve the same functionality.

Thanks and regards,

Hassan
0
Victor
Telerik team
answered on 21 Jan 2009, 02:41 PM
Hi Hassan,

Thanks for your question.

I have found a solution but I am afraid that only some sites can be scrolled and that flickering occurs because there is no sensible way to get the height of the currently displayed page.

I have attached a sample application demonstrating what I mean. This is the best I could do and I would not recommend this approach because of the flickering and the failure to scroll on some sites.

I hope this can at least give you a starting point to do further research. I think that the WebBrowser control was not designed to work with a custom scroll bar.

Please write again if you have other issues or questions.

Best wishes,
Victor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Haroon
Top achievements
Rank 1
answered on 28 Jan 2009, 09:26 AM
Salam! i have tried the method u have suggested for theming scroll bars. Although it works well at design time and specified theme has been loaded and applied to Tree view scroll bar however it is not being applied at runtime. That is, whenever u run the project the scroll bar of tree view is loaded with default theme instead of one specified by me. Kindly guide me in this regard.

Regards,
Haroon
0
Jordan
Telerik team
answered on 30 Jan 2009, 11:27 AM
Hi Haroon,

It seems that the theme is not available at run time. Please take a look at the following resources:

The possible ways of adding custom themes to your project are given in this article:
http://www.telerik.com/support/kb/article/b454K-mmh-b454T-ckd-b454c-ckd.aspx
 
For additional information on making themes you can read this forum thread:
http://www.telerik.com/community/forums/thread/b311D-gdcka.aspx

Do not hesitate to write me back if you have more questions.

Regards,
Jordan
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Stefan
Telerik team
answered on 22 Mar 2011, 02:45 PM

Hello guys,

Please note that in Q1 2011 we have introduced a major upgrade of RadTreeView control, which is now virtualized and fully customizable. Feel free to download the latest release and try it out. For more information on our latest release refer to this blog post.

Best wishes,
Stefan
the Telerik team
Tags
Treeview
Asked by
Hassan
Top achievements
Rank 1
Answers by
Victor
Telerik team
Hassan
Top achievements
Rank 1
Haroon
Top achievements
Rank 1
Jordan
Telerik team
Stefan
Telerik team
Share this question
or