loosing node color on client-side node drag/drop

2 posts, 0 answers
  1. Denis
    Denis avatar
    5 posts
    Member since:
    Oct 2008

    Posted 09 Sep 2009 Link to this post


    I've a standard radtreeview control populated on the server side by sql datas. Depending on the node type i set the node ForeColor property. When i do a client-side drag/drop i'm loosing the node color. It's probably a newbee question but how can i keep the original node color ?

    Thanks in advance for the help.
  2. Clyde
    Clyde avatar
    41 posts
    Member since:
    Feb 2008

    Posted 27 Jan 2013 Link to this post

    The solution is to rather set the node.CssClass to equal a CSS style that has the color you want.

    For my requirements, I needed nodes that opened in a new browser window in green. I had client side drag and drop, as well as new node creation.

    Create a style for your page
    .greenNode {
        color: green;

    Then in your code behind, simply assign the node the style.

    protected void RadTreeView1_NodeDataBound(object sender, RadTreeNodeEventArgs e)
        DataRowView dbRow = (DataRowView)e.Node.DataItem;
        e.Node.Attributes["UrlTarget"] = dbRow["UrlTargetNewWindow"].ToString();
        if (Convert.ToBoolean(dbRow["UrlTargetNewWindow"]))
            e.Node.CssClass = "greenNode";

    The CCS style is retained with the node when dragging and dropping.
Back to Top