Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
270
UltraTreeview within WebDropDown control
posted

Per a previous thread, it was suggested to use put the UltraTreeView control within the WebDropdown control's ItemTemplate tag. Visual Studio 2008 removes the reference from the designer. If manually put in, the control is NULL. If I copy the markup outside of the WebDropDown, the reference within the designer is added and the control works as expected.

I have a need for the TreeView control to be in either a dropdown or a combobox type control. Is this possible? Please provide a sample so I can implement within my proof-of-concept.

Thanks.

Parents
No Data
Reply
  • 24671
    posted

    Hi,

    Here is the code that will embed an UltraWebTree inside the DropDown's container. Note that you can further improve this example by removing hover/selected style for the dropdown item (so that you don't get any color change while you manipulate the actual Ultra Web Tree). Also you can turn off EnableClosingDropDownOnSelect=false, so that the dropdown doesn't close when you manipulate the UltraWebTree. From there on, you can set / get values from the ultra web tree to the dropdown using client-side events, as it is shown in the WebDataGrid template sample in the WebDropDown 2009.1 samples.

    Also note there is only 1 DropDown item in the items collection, because if you have more, it will create an instance of the UltraWebTree for every item, so you will get many UltraWebTrees rendered one after another in the DropDown container.

     

     

          <ig:WebDropDown runat="server" ID="WebDropDown2" Width="200px">

            <Items>

            <ig:DropDownItem Text="something"></ig:DropDownItem>

            </Items>

            <ItemTemplate>

            <ignav:UltraWebTree ID="UltraWebTree1" runat="server">

            <Nodes>

            <ignav:Node Text="Root 1">

            <Nodes>

            <ignav:Node Text="Child 1"></ignav:Node>

              <ignav:Node Text="Child 2"></ignav:Node>

                <ignav:Node Text="Child 3"></ignav:Node>

            </Nodes>

            </ignav:Node>

            <ignav:Node Text="Root 2"></ignav:Node>

            <ignav:Node Text="Root 3"></ignav:Node>

            </Nodes>

            </ignav:UltraWebTree>

            </ItemTemplate>

            </ig:WebDropDown>

     

     

    Hope it helps,

    Angel 

Children