Design treelist

4 posts, 1 answers
  1. Tina
    Tina avatar
    130 posts
    Member since:
    Jul 2011

    Posted 07 Nov 2011 Link to this post

    How can i place a radgrid in treelist?
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 07 Nov 2011 Link to this post

    Hello Tina,

    Try the following code.
    aspx:
    <telerik:RadTreeList ID="RadTreeList1" runat="server" DataSourceID="SqlDataSource2" ParentDataKeyNames="ReportsTo" DataKeyNames="EmployeeID" AutoGenerateColumns="true">
      <DetailTemplate>
         <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" AutoGenerateColumns="true">
         </telerik:RadGrid>
      </DetailTemplate>
    </telerik:RadTreeList>

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Tina
    Tina avatar
    130 posts
    Member since:
    Jul 2011

    Posted 08 Nov 2011 Link to this post

    Thanks shinu.
    I want to add a combobox in itemtempolate dynamically.Can you help on this?
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 08 Nov 2011 Link to this post

    Hello,

    Try the following code snippet in ItemDataBound event.
    C#:
    protected void RadTreeList1_ItemCreated(object sender, TreeListItemCreatedEventArgs e)
    {
     if (e.Item is TreeListDataItem)
     {
      TreeListDataItem item = e.Item as TreeListDataItem;
      TableCell cell = (TableCell)item["TemplateColumnUniqueName"];
      RadComboBox combo = new RadComboBox();
      combo.DataValueField = "LastName";
      combo.DataTextField = "LastName";
      combo.DataSourceID = "SqlDataSource1";
      cell.Controls.Add(combo);
     }
    }

    -Shinu
Back to Top