Click here to Skip to main content
15,901,373 members
Please Sign up or sign in to vote.
1.75/5 (4 votes)
See more:
I need to show the show datas in treeview inside a comboxbox..Can any one say or give a control with source so that i can customize to my reqirements
Posted
Comments
BillWoodruff 13-Dec-15 2:31am    
I think this idea is a mistake that will cost you a lot of time and energy and never look "right." Why not have the selection in the ComboBox pop-up, or make visible, the TreeView (if it's not visible).

Another idea would be to use cascading nested menus to present the hierarchy; imho, that's more achievable.
fakeer muhammed 13-Dec-15 2:52am    
can u give an example or source for it so that i will try it
BillWoodruff 13-Dec-15 2:59am    
Hi Fakeer, I'm happy to share my ideas, as comments; but, I am here to teach programming; I'll be happy to assist you when you start experimenting and implementing your UI elements, as you post specific questions, and code, related to your work in progress.

By the way, I don't work in ASP.NET; so, I have no experience with what may be the unique aspects of the Controls provided there compared to Windows Forms.

If your UI in ASP.NET permits you to effectively show/hide a TreeView, then I'd encourage to pursue that. I have implemented dynamic nested menus created from a Tree structure in Windows Forms, but found such a UI was not effective if it presented more than three, or four, levels of "nesting."

You could also consider showing/hiding ComboBoxes on-the-fly as a way to present a choice in a hierarchy.

I suggest you create simple projects using ASP.NET where you can isolate, and focus on, only the different UI approaches you want to isolate. imho, prototyping early is always a good thing.

cheers, Bill
Rajdeep Debnath 13-Dec-15 4:52am    
How many levels of nesting your treeview will have?

If 2/3 level, can we use 2/3 drop downs?

Or in ASP.Net you can create in CustomControl

1 solution

Do you need something like this?

XML
<Grid>
    <ComboBox x:Name="comboBox" HorizontalAlignment="Left" Height="41" Margin="62,44,0,0" VerticalAlignment="Top" Width="347">
        <ComboBoxItem>
            <ComboBoxItem.Template>
                <ControlTemplate>
                    <TreeView Height="auto">
                        <TreeViewItem Header="Level 1 A" />
                        <TreeViewItem Header="Level 1 B" IsExpanded="True" >
                            <TreeViewItem Header="Level 2"/>
                        </TreeViewItem>
                    </TreeView>
                </ControlTemplate>
            </ComboBoxItem.Template>
        </ComboBoxItem>
    </ComboBox>

</Grid>
 
Share this answer
 
Comments
Richard Deeming 18-Dec-15 13:34pm    
That's WPF. The question is tagged as ASP.NET.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900