RadDropDowmTree

8 posts, 0 answers
  1. Vishram
    Vishram avatar
    3 posts
    Member since:
    May 2014

    Posted 19 May 2014 Link to this post

    Hi, I am writing the statement like,
     int value=Convert.ToInt32(objRadDropDowmTree.EmbadedTree.Nodes[1].Value);

    But its showing an error "Input string was not correct"
     Please tell me, how to access any specific node value? 

    Please also help me, how to assign tooltip in RadDropDowmTree Nodes .
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 19 May 2014 in reply to Vishram Link to this post

    Hi Vishram,

    Please have a look into the C# code snippet to access the value of the node and assign tooltip for the node.

    C#:
    protected void RadDropDownTree1_NodeDataBound(object sender, DropDownTreeNodeDataBoundEventArguments e)
    {
        string value = string.Empty;
        foreach (RadTreeNode node in RadDropDownTree1.EmbeddedTree.Nodes)
        {
            node.ToolTip = node.Text;
            value = node.Value;
            foreach (RadTreeNode subnode in node.GetAllNodes())
            {
                subnode.ToolTip = subnode.Text;
            }
        }
    }

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Vishram
    Vishram avatar
    3 posts
    Member since:
    May 2014

    Posted 19 May 2014 in reply to Shinu Link to this post

    Hi Shinu,
     Actually I am accessing node value using index, and assigning that value in a integer variable but showing "input string was not correct"...

    Please see this statement....  

     int value= Convert.ToInt32(objRadDropDowmTree.EmbadedTree.Nodes[1].Value);
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 19 May 2014 in reply to Vishram Link to this post

    Hi Vishram,

    The error means that the string you are trying to parse an integer doesn't actually contain a valid integer. Can you please check the DataValueField have integer values. Please have a look into the sample code snippet which works fine at my end.

    ASPX:
    <telerik:RadDropDownTree ID="RadDropDownTree1" runat="server" DataSourceID="SqlDataSource1"
        DataTextField="text" DataFieldID="id" DataFieldParentID="parentid" DataValueField="id">
    </telerik:RadDropDownTree>
    <telerik:RadButton ID="RadButton1" runat="server" Text="Value" OnClick="RadButton1_Click">
    </telerik:RadButton>

    C#:
    protected void RadButton1_Click(object sender, EventArgs e)
    {
        int value = Convert.ToInt32(RadDropDownTree1.EmbeddedTree.Nodes[1].Value);
    }

    Please provide your full code if it doesn't help.
    Thanks,
    Shinu.
  6. Asutosh
    Asutosh avatar
    130 posts
    Member since:
    Sep 2013

    Posted 22 Jul 2014 in reply to Shinu Link to this post

    hi shinu 
    i am using raddropdown tree
    i want to add tool tip in that 
    like 
    i have 
    manager
       -abc 
       -def 
       -ghi
       -abcdefghi
    employee
       -opq
       -wer
       -abcdefghijkl

    i have data like that where manager is parent and abc,def,ghi,abcdefghi are child of that
    so i want to show abcd... when name is long and when hover on that name will show in tool tip 
    how can i set that?







  7. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 22 Jul 2014 in reply to Asutosh Link to this post

    Hi Asutosh,

    Please try the below JavaScript to achieve your scenario.

    JavaScript:
    function pageLoad() {
        var treeView = $find("<%=rtreeviewEmployees.ClientID%>");
        var count = treeView.get_allNodes().length, index, node;
        for (index = 0; index < count; index++) {
            node = treeView.get_allNodes()[index];
            if (node._hasChildren() == false) {
                if (node.get_text().length > 4) {
                    node._element.title = node.get_text();
                    node.set_text(node.get_text().substring(0, 4) + "...");
                }
            }
        }
    }

    Thanks,
    Shinu.
  8. Asutosh
    Asutosh avatar
    130 posts
    Member since:
    Sep 2013

    Posted 22 Jul 2014 in reply to Shinu Link to this post

    hi shinu thanks for your reply
    bt its not works at my end
    and i dont want to formate data 
    i jst want to display formate 
    like i have done in below code
    this way i want to do
    name will  b there bt it show limited width then show ...  
    how can i do in raddropdown tree?
     <div style="white-space: nowrap; overflow: hidden; position: absolute; text-overflow: ellipsis; width: 32%; height: 30px; margin-top: -20px; color: white; margin-left: 60px">
                                                <asp:Label ID="lblfirstdivheader" runat="server" Text="" Style="color: white; background-color: #404040"></asp:Label>
                                            </div>
  9. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 22 Jul 2014 in reply to Asutosh Link to this post

    Hi Asutosh,

    Please try the below CSS code snippet to achieve your scenario.

    CSS:
    div.RadTreeView .rtIn
    {
        overflow: hidden;
        text-overflow: ellipsis;
        display: inline-block;
    }
    div.RadTreeView .rtUL .rtIn
    {
        width: 80px;
    }
    div.RadTreeView .rtUL .rtUL .rtIn
    {
        width: 50px;
    }

    Thanks,
    Shinu.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017