How To: Filter as you type RadGridView inside RadComboBox for WPF and Silverlight

Posted on Dot net Slackers See other posts from Dot net Slackers
Published on Fri, 09 Apr 2010 00:00:00 GMT Indexed on 2010/04/09 6:53 UTC
Read the original article Hit count: 675

Filed under:

Ive made small example on how to place RadGridView inside editable RadComboBox and filter the grid items as you type in the combo:

image

 

The easiest way to place any UI element in RadComboBox is to create single RadComboBoxItem and define desired Template:

<telerikInput:RadComboBox  Text="{Binding  Text,  Mode=TwoWay}"
                           IsEditable="True"  Height="25"  Width="200">
    <telerikInput:RadComboBox.Items>
        <telerikInput:RadComboBoxItem>
            <telerikInput:RadComboBoxItem.Template>
                <ControlTemplate>
                    <telerikGrid:RadGridView  x:Name="RadGridView1"  ShowGroupPanel="False"  CanUserFreezeColumns="False" 
                                              RowIndicatorVisibility="Collapsed"  IsReadOnly="True"
                                              IsFilteringAllowed="False"  ItemsSource="{Binding  Items}" 
                                              Width="200"  Height="150"  SelectedItem="{Binding  SelectedItem,  Mode=TwoWay}">
                    </telerikGrid:RadGridView>
                </ControlTemplate>
            </telerikInput:RadComboBoxItem.Template>
        </telerikInput:RadComboBoxItem>
    </telerikInput:RadComboBox.Items>
</telerikInput:RadComboBox>


Now you can create small view model and bind ...

Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.



Email this Article

© Dot net Slackers or respective owner