Multi-column Treeview

9 posts, 0 answers
  1. Levi
    Levi avatar
    134 posts
    Member since:
    Jul 2008

    Posted 15 Jul 2008 Link to this post

    I was wondering if there is a way to do a 2 column treeview? My treeview is simple, but I'm using two columns to save space. Only way I can think to do it is to deselect all nodes from the adjacent treeview each time a node is selected? Any ideas on the best way to implement something like this?

    Great product by the way. Simply awesome. The skins, performance, everything, is the best around.

    Thanks,
    Levi
  2. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 18 Jul 2008 Link to this post

    Hello Levi,

    Indeed, I am not quite sure what do you mean by "two column treeview".
    Have you checked the Templates section in our:
    I hope this will get you started.

    All the best,
    Veskoni
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. alicia@afm
    alicia@afm avatar
    9 posts
    Member since:
    Jan 2007

    Posted 19 May 2009 Link to this post

    Hello,

    I too need a 'multicolumn tree view' - something similar to this: 
    http://extjs.com/deploy/dev/examples/tree/column-tree.html

    What I need to implement is a sleek UI for assigning access rights.
    On the left side I will have a simple Tree with Roles / Users;

    On the right side I need a multi-column TreeView with a few columns:
    • one column with the actual Tree: the resources to be accessed (categories and subcategories)
    • multiple columns with check boxes for each access right

    Do you have any suggestions on how I could implement such a Tree View?

    Thanks!
    Alicia

  5. Jay O'Brien
    Jay O'Brien avatar
    39 posts
    Member since:
    Dec 2008

    Posted 02 Jun 2009 Link to this post

    Does anyone know if a multicolumn tree control is possible (easily) in Telerik? Another example of the kind I want to build in Telerik is at http://demos.devexpress.com/ASPxTreeListDemos/Appearance/GridLinesTreeLines.aspx

    Thanks!
    Jay (happy Telerik customer)
  6. alicia@afm
    alicia@afm avatar
    9 posts
    Member since:
    Jan 2007

    Posted 02 Jun 2009 Link to this post

    Actually I forgot to post my findings - you can do it using the NodeTemplate. It will probably take a bit of work to align things properly (I haven't spend any time aligning children columns to parents yet), but to actually build and bind the 'extra' controls in  a NodeTemplate is really easy (as you can see from the picture bellow). 

    The code for NodeTemplate goes along these lines:

     

    <telerik:RadTreeView ID="tv" runat="server" CheckBoxes="false" OnNodeDataBound="tv_NodeDataBound" OnDataBinding="tv_DataBinding" >

     

     

    <DataBindings>

     

     

    <telerik:RadTreeNodeBinding/>

     

     

    </DataBindings>

     

     

    <NodeTemplate>

     

     

    <table width="500px" cellpadding="0" cellspacing="0" border="0">

     

     

    <tr>

     

     

    <td><%# DataBinder.Eval(Container, "Text") %></td>

     

     

    <td width="40px"><asp:CheckBox ID="chkDeny" runat="server" OnCheckedChanged="chkDeny_CheckedChanged" AutoPostBack="true" /> </td>

     

     

    <td width="40px"><asp:CheckBox ID="chkView" runat="server" OnCheckedChanged="chkView_CheckedChanged" AutoPostBack="true" /> </td>

     

     

    <td width="40px"><asp:CheckBox ID="chkCreate" runat="server" OnCheckedChanged="chkCreate_CheckedChanged" AutoPostBack="true" /> </td>

     

     

    <td width="40px"><asp:CheckBox ID="chkUpdate" runat="server" OnCheckedChanged="chkUpdate_CheckedChanged" AutoPostBack="true" /></td>

     

     

    <td width="40px"><asp:CheckBox ID="chkDelete" runat="server" OnCheckedChanged="chkDelete_CheckedChanged" AutoPostBack="true" /></td>

     

     

    </tr>

     

     

    </table>

     

     

    </NodeTemplate>

     

     

    </telerik:RadTreeView>

     

     

     

    As I load my data from an XML, binding the CheckBox state goes something like this:

    CheckBox deny = (CheckBox)currentTreeNode.FindControl("chkDeny");

     

     

    if (deny != null)

     

    {

     

        XmlAttribute attr = node.Attributes["IsDenied"];

     

        deny.Checked = (attr !=

    null && attr.Value == "1");

     

    }

     




    Hope it helps,

    Alicia
  7. Levi
    Levi avatar
    134 posts
    Member since:
    Jul 2008

    Posted 02 Jun 2009 Link to this post

    The DevExpress example is exactly what I was referring to. Nesting messy grids simply does not work as well when trying to display hierarchical data in a clean fashion. There really should be an easy way to do something similar to the example posted earlier below.
    http://demos.devexpress.com/ASPxTreeListDemos/Appearance/GridLinesTreeLines.aspx

    This addition would be great to the already awesome Telerik libraries.

    Levi


  8. Jay O'Brien
    Jay O'Brien avatar
    39 posts
    Member since:
    Dec 2008

    Posted 02 Jun 2009 Link to this post

    Thanks, that makes sense.

    I think you are right - aligning things properly will be very hard ... probably VERY hard (I cant see your uploaded image).

    Thanks,
    Jay
  9. alicia@afm
    alicia@afm avatar
    9 posts
    Member since:
    Jan 2007

    Posted 02 Jun 2009 Link to this post

    And I couldn't agree more with Levi's comments - yes, I believe adding such a feature to telerik TreeView control would be a wonderful idea :)

    Alicia
  10. Naresh
    Naresh avatar
    45 posts
    Member since:
    Jul 2008

    Posted 29 Jun 2009 Link to this post

    Did you get the alignment right?, struggling to get the alignment right, and i couldn't get it.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017