nothing display under itemtemplate

2 posts, 0 answers
  1. appdev
    appdev avatar
    223 posts
    Member since:
    Sep 2008

    Posted 12 Jul 2009 Link to this post

    i'm trying to do this and i have nothing display in the listbox . so how do i fix that. and then eventually i want to be able to move that a childnode in the tree in radlist to second radlist. the seocond radlist does not need to have a tree. so if the childnode in radtree in radlist1 get transfer over to radlist2, it will just be an item in radlist2. but i want to be able to move that item back to the childnode in radtree in radlist1 too. so how do i do that in a radtree in radlistbox. i think i might be better off with just radtree. but how do i reorder radtree or do transfer or double click just like radlistbox. or better yet can you change an item background or forecolor in radlist? can you help me  please. thanks.
    <telerik:RadListBox align="left" Height="200px" AllowTransferOnDoubleClick="true"   
         AllowTransfer="true" AllowTransferAll="true" TransferToID="RadListBox2"   
         Width="300px" ID="RadListBox1" runat="server" SelectionMode="Multiple" >  
               <ItemTemplate>  
                    <telerik:RadTreeView ID="test" runat="server">  
                         <Nodes>  
                            <telerik:RadTreeNode runat="server" Text="South America" Expanded="true">  
                                 <Nodes>  
                                      <telerik:RadTreeNode runat="server" Text="New Brazil">  
                                      </telerik:RadTreeNode>  
                                      <telerik:RadTreeNode runat="server" Text="Rio de Janeiro">  
                                      </telerik:RadTreeNode>  
                                 </Nodes>  
                            </telerik:RadTreeNode>  
                         </Nodes>  
                    </telerik:RadTreeView>  
               </ItemTemplate>  
    </telerik:RadListBox> 
  2. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 14 Jul 2009 Link to this post

    Hello Duy,

    Nothing is shown in this case because the listbox does not have any items - please add one:

    <telerik:RadListBox align="left" Height="200px" AllowTransferOnDoubleClick="True" 
        AllowTransfer="True" AllowTransferAll="true" TransferToID="RadListBox2" Width="300px" 
        ID="RadListBox1" runat="server" SelectionMode="Multiple" Skin="Forest"
        <ItemTemplate> 
            <telerik:RadTreeView ID="test" runat="server"
                <Nodes> 
                    <telerik:RadTreeNode runat="server" Text="South America" Expanded="true"
                        <Nodes> 
                            <telerik:RadTreeNode runat="server" Text="New Brazil"
                            </telerik:RadTreeNode> 
                            <telerik:RadTreeNode runat="server" Text="Rio de Janeiro"
                            </telerik:RadTreeNode> 
                        </Nodes> 
                    </telerik:RadTreeNode> 
                </Nodes> 
            </telerik:RadTreeView> 
        </ItemTemplate> 
        <Items> 
            <telerik:RadListBoxItem /> 
        </Items> 
    </telerik:RadListBox> 

    If you add another listbox item - the treeview will be doubled since the ItemTemplate will be applied for all items. So, if you have just one listbox item - the reordering will not work. You can reorder the nodes of the treeview by using drag and drop and EnableDragAndDropBetweenNodes = true

    In addition the treeview supports OnClientDoubleClick event so you can subscribe to it and perform the necessary actions.

    Regards,
    Veselin Vasilev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top