How to determine the ID parent of adding?

4 posts, 0 answers
  1. Jean
    Jean avatar
    2 posts
    Member since:
    Jan 2011

    Posted 17 Jan 2013 Link to this post

    how to determine the id parent of adding in TreeList?
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 18 Jan 2013 Link to this post

    Hi,

    I suppose you want to get the parent of the TreeListItem. Try the following code snippet.

    C#:
    protected void RadTreeList1_ItemDataBound(object sender, TreeListItemDataBoundEventArgs e)
        {
            if (e.Item is TreeListDataItem )
            {
                TreeListDataItem item=(TreeListDataItem)e.Item;
                Response.Write(item["parent"].Text);
            }
        }

    Hope this helps.

    Regards,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jean
    Jean avatar
    2 posts
    Member since:
    Jan 2011

    Posted 18 Jan 2013 Link to this post

    I imell view when you click on the button to add or change. How to determine which element is clicked (the ID).
    P.S. I am sorry for my english I'm from Russia)).
  5. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 20 Jan 2013 Link to this post

    Hi,

    Try the following code snippet to achieve your scenario.

    C#:
    protected void RadTreeList1_ItemCommand(object sender, TreeListCommandEventArgs e)
    {
        if (e.CommandName == RadTreeList.EditCommandName)
        {
            TreeListDataItem item = (TreeListDataItem)e.Item;
            string value = item["UniqueName"].Text;
        }
        if (e.CommandName == RadTreeList.InitInsertCommandName)
        {
            TreeListDataItem item = (TreeListDataItem)e.Item;
            string value = item["UniqueName"].Text;
        }
    }

    Hope this helps.

    Regards,
    Princy.
Back to Top