TreeListSelectColumn-- How to get column value of selected rows

4 posts, 0 answers
  1. Priya
    Priya avatar
    10 posts
    Member since:
    Dec 2012

    Posted 26 Dec 2012 Link to this post

    Hi,

    I am adding TreeListSelectColumn programatically:

     

     

    Dim selectColmn As New TreeListSelectColumn()

     

    selectColmn =

     

    New TreeListSelectColumn()

     

    selectColmn.HeaderText =

     

    "select"

     

    selectColmn.UniqueName =

     

    "select"

     

    RadTreeList1.Columns.Add(selectColmn)


    and I have a template column for displaying Invoice # but column value is 'inv_id'

    templateColumn =

     

    New TreeListTemplateColumn()

     

    templateColumn.HeaderText =

     

    "Invoice #"

     

     

     

    templateColumn.UniqueName = "inv_id"

     

    templateColumn.ItemTemplate =

     

    New InvTemplColumn(templateColumn.DataField)

     

    RadTreeList1.Columns.Add(templateColumn)

    After selecting few invoices I want to perform some actions like- export,print, for which I need inv_id of selected rows(inv_id is not visible in treelist), but I am not able to get inv_id of selected rows.Is there any option using which I can bind value to selectcolumn. Please let me know if you have any solution. It's very urgent.
    Thanks in advance.

  2. Shinu
    Shinu avatar
    16988 posts
    Member since:
    Mar 2007

    Posted 26 Dec 2012 Link to this post

    Hi,

    Try the following code.
    VB:

    Protected Sub Button1_Click(sender As Object, e As EventArgs)
        For Each item As TreeListDataItem In RadTreeList1.SelectedItems
            Dim value As String = item("Uniquename").Text
        Next
    End Sub

    Thanks,
    Shinu.

  3. Priya
    Priya avatar
    10 posts
    Member since:
    Dec 2012

    Posted 27 Dec 2012 Link to this post

    Thanks for the code , but is there any option using wich I can do it through Javascript.
    Thanks in advance.

  4. Shinu
    Shinu avatar
    16988 posts
    Member since:
    Mar 2007

    Posted 27 Dec 2012 Link to this post

    Hi,

    Try the following code.
    JS:

    function OnClientClick()
    {
     var tree = $find("<%=RadTreeList1.ClientID%>");
     for (var i = 0; i < tree.get_selectedItems().length; i++)
     {
      alert(tree.getCellByColumnUniqueName(tree.get_selectedItems()[i], "UniqueName").innerHTML);
     }
    }

    Thanks,
    Shinu.

Back to Top