Inheriting from RadTreeView

2 posts, 0 answers
  1. xrimson
    xrimson avatar
    7 posts
    Member since:
    Sep 2009

    Posted 06 Feb 2012 Link to this post

    Are there any examples out there on how to inherit from RadTreeView?  I want override both the server side component AND the client side AJAX component.

    I can easily override the server side component, but the problem being that both RadTreeView & MyTreeView has their own AJAX component and I am running into problems when radTreeView fires onCollapsed, the variables initialized in MyTreeView AJAX component are null.

    So I really would like to have myTreeView AJAX component inherit from the RadTreeView AJAX component.  After inheriting from RadTreeVIew is there a way to turn off the AJAX component and just use the inherited one from MyTreeView?
  2. Simon
    Simon avatar
    2281 posts

    Posted 13 Feb 2012 Link to this post

    Hi xrimson,

    You can disable all scripts of a RadControl for ASP.NET AJAX by setting its EnableEmbeddedScripts property to false and use your custom JavaScript code, however it is advisable that you do not do this because you will have to implement from scratch every functionality you need.

    It's easier to build on top of RadTreeView's client-side component in your inherited TreeView. You can register the additional JavaScript files with the ClientScriptResourceAttribute (type-level) in this way:
    [ClientScriptResource("AssemblyName", "ScriptResourcePath.js")]

    I hope this helps.

    Kind regards,
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Back to Top