Class added to Node does not persist after postback

2 posts, 0 answers
  1. Craig
    Craig avatar
    14 posts
    Member since:
    Oct 2013

    Posted 14 Aug 2014 Link to this post

    I have two RadTreeViews and am using these to create a data picker... so Available nodes on the left treeView... User Selected nodes on the right treeView...

    After the user has selected a node and moved it to the right treeView, I would like to style the nodes as follows:

    SelectedNode : Bold [Node Enabled]
    ParentNode: Grey [Node Disabled & Node Expanded]
    ChildNodes: Normal font [Node Disabled]

    I use javascript to achieve this, which works fine the first time round using the 'window.onload' event.

    Issue: When I postback the page... all settings remain in place (eg - enabled/disabled) but the styles do not.

    I use the trackChanges() and commitChanges() around my javascript code.

    I am using the following to remove classes
    $telerik.$(node.get_element()).removeClass('bold');

    I am using the following to add classes:
    $telerik.$(node.get_element()).addClass('bold'); - Does not persist

    I am using the following to enable / disable nodes
    node.set_enabled(true); - Persists fine...

    Can anyone advise why the settings persist but the css styles do not?

    Thanks
  2. Craig
    Craig avatar
    14 posts
    Member since:
    Oct 2013

    Posted 14 Aug 2014 in reply to Craig Link to this post

    I've found it... node.set_cssClass('myclass')

    should have taken a guess!
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top