Desktop
WPF
It seems that there are many developers that want to use this combo, as my previous blog posts are quite popular. The problem with the suggested solution is that you need to customize the control template of RadComboBox. There is a much easier way to put a RadTreeView in a Popup – by using a RadDropDownButton: <telerik:RadDropDownButton HorizontalContentAlignment="Left" DropDownWidth="200" IsOpen="{Binding SelectedItem, Converter={StaticResource ObjectToFalseConverter}, ElementName=TreeView, Mode=TwoWay}" Content="{Binding SelectedItem.Text, FallbackValue='Please, select an item.', ElementName=TreeView}"> <telerik:RadDropDownButton.DropDownContent> <telerik:RadTreeView x:Name="TreeView" ItemsSource="{StaticResource Items}" ItemTemplate="{StaticResource ItemTemplate}" /> </telerik:RadDropDownButton.DropDownContent> </telerik:RadDropDownButton>
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; } This way you could easily access the RadTreeView instance in the code-behind, however I would recommend using a ViewModel and bindings instead. The DropDownButton Content property is bound to the SelectedItem property of...