This is a migrated thread and some comments may be shown as answers.

[Solved] Search as you type using DS to MVVM

0 Answers 78 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Almond
Top achievements
Rank 1
Almond asked on 28 Apr 2011, 02:16 PM

Good pm Telerik Gurus,

I would just like to ask if any has successfully  implemented a search as you type module using DS to MVVM?  I have been trying to implement it for days now and until now i have been unsuccessful.  Please see some of my code below.

public SearchRSViewModel()
{
    aimsDomainContext context = new aimsDomainContext();
    EntityQuery<tbl_rssummary> getrsSummaryQuery = context.GetTbl_rssummaryIncQuery();
    this.items = new QueryableDomainServiceCollectionView<tbl_rssummary>(context, getrsSummaryQuery);
    this.items.PageSize = 10;
    this.items.AutoLoad = true;
}
 I have successfully populated the RadDataGridView in the XAML below:

<UserControl.Resources>
    <my:SearchRSViewModel x:Key="ViewModel" />
</UserControl.Resources>
<Grid x:Name="LayoutRoot" DataContext="{StaticResource ViewModel}" Margin="0,40,0,0">
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="Auto" />
        <ColumnDefinition Width="0" />
        <ColumnDefinition Width="Auto" />
        <ColumnDefinition Width="136*" />
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
        <RowDefinition Height="40*" />
        <RowDefinition Height="209*" />
        <RowDefinition Height="191*" />
    </Grid.RowDefinitions>
    <telerik:RadGridView Name="RadGridView1" ItemsSource="{Binding Items}" IsFilteringAllowed="False" 
                         Margin="2" AutoGenerateColumns="False" Grid.Row="1" 
                         Width="Auto">
        <telerik:RadGridView.Columns>
                            <telerik:GridViewDataColumn UniqueName="rs_idno" HeaderCellStyle="{StaticResource gridHdrStyle}" 
                                                        HeaderTextAlignment="Center" Header="ID" 
                                                        IsVisible="False" />
                            <telerik:GridViewDataColumn UniqueName="rs_date" MinWidth="120" HeaderCellStyle="{StaticResource gridHdrStyle}"
                                                        HeaderTextAlignment="Center"  DataFormatString="{}{0:dd-MMM-yy}" 
                                                        Header="DATE" TextAlignment="Right" />
                            <telerik:GridViewDataColumn UniqueName="comp_abbr" MinWidth="150" HeaderCellStyle="{StaticResource gridHdrStyle}" 
                                                        HeaderTextAlignment="center" Header="COMPANY" 
                                                        TextAlignment="Right" />
                            <telerik:GridViewDataColumn UniqueName="rs_stat_desc" MinWidth="230" HeaderCellStyle="{StaticResource gridHdrStyle}" 
                                                        HeaderTextAlignment="center" Header="STATUS" 
                                                        TextAlignment="Right" />
        </telerik:RadGridView.Columns>
    </telerik:RadGridView>
    <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom" 
              HorizontalAlignment="Left" Margin="0,0,0,6" Grid.Row="0">
        <TextBlock VerticalAlignment="Center" 
                Text="Search by Company: " FontWeight="Bold" HorizontalAlignment="Center"/>
            <TextBox x:Name="CompanyText" Width="200" TextChanged="FilterValue_TextChanged" 
              FontSize="11" Margin="4" Text=""  />
    </StackPanel>
</Grid>

Hope someone can shed light on my problem.

Thanks in advance...

Tags
GridView
Asked by
Almond
Top achievements
Rank 1
Share this question
or