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

[Solved] filtering in grid view

1 Answer 109 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.
Deepak Garla
Top achievements
Rank 1
Deepak Garla asked on 05 Oct 2009, 07:00 PM

Gridview sorting, filtering and grouping not working

 

My xaml file looks as given below-

<UserControl x:Class="BP.Alaska.CICMT.SL.Inbox_AllMitigations.Inbox_AllMitigations"

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

xmlns:telerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"

xmlns:telerikGrid="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" 

xmlns:telerikGridView="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView"

xmlns:my="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data" 

xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"

xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"         

xmlns:d="http://schemas.microsoft.com/expression/blend/2008"        

    Width="1200" Height="720">

    <Grid x:Name="LayoutRoot" Background="White">

        <TextBox x:Name="txtboxGroupMitigationsBy" HorizontalAlignment="Left" Margin="40,20,0,0" VerticalAlignment="Top" Text="Group Mitigations By" TextWrapping="Wrap"   FontSize="10.667" FontFamily="Verdana" Foreground="#FF009900" FontWeight="Bold" BorderThickness="0" />

        <telerikInput:RadComboBox x:Name="radcmbGroupMitigationsBy" HorizontalAlignment="Left" Width="135" Margin="40,45,0,0" VerticalAlignment="Top">

            <telerikInput:RadComboBox Height="25" Width="0"/>

            <telerikNavigation:RadTreeView x:Name="radtvGroupMitigationsBy" SelectionMode="Multiple">

            </telerikNavigation:RadTreeView>

        </telerikInput:RadComboBox>

        <TextBox x:Name="txtboxWorkFlowStatus" HorizontalAlignment="Left" Margin="212,20,0,0" VerticalAlignment="Top" Text="Workflow Status" TextWrapping="Wrap"   FontSize="10.667" FontFamily="Verdana" Foreground="#FF009900" FontWeight="Bold" BorderThickness="0" />

        <telerikInput:RadComboBox x:Name="radcmbWorkFlowStatus" HorizontalAlignment="Left" Width="135" Margin="212,45,0,0" VerticalAlignment="Top" FontFamily="Verdana">

            <telerikInput:RadComboBox Height="25" Width="0"/>

        </telerikInput:RadComboBox>

        <TextBox x:Name="txtboxMyFilters" Margin="371,20,272,0" VerticalAlignment="Top" Text="My Filters" TextWrapping="Wrap"   FontSize="10.667" FontFamily="Verdana" Foreground="#FF009900" FontWeight="Bold" BorderThickness="0"/>

        <telerikInput:RadComboBox Margin="371,45,350,0" VerticalAlignment="Top" FontFamily="Verdana">

            <telerikInput:RadComboBox x:Name="radcmbMyFilters" Height="25" Width="0"/>

            <telerikNavigation:RadTreeView x:Name="radtvFilters" SelectionMode="Single">

            </telerikNavigation:RadTreeView>

        </telerikInput:RadComboBox>

        <Button HorizontalAlignment="Left" x:Name="btnAddModifyFilter" Content="Add\Modify My Filters"  Margin="371,75,0,0" VerticalAlignment="Top" Width="140" Height="20" BorderThickness="0" Background="Transparent" BorderBrush="Transparent" FontSize="10.667" FontFamily="Verdana" Foreground="#FF009900" FontWeight="Bold" Click="btnAddModifyFilter_Click">

        </Button>

        <Button HorizontalAlignment="Right" x:Name="btnClearSearch" Content="Clear Search"  Margin="0,75,95,0" VerticalAlignment="Top" Width="140" Height="20" BorderThickness="0" Background="Transparent" BorderBrush="Transparent" FontSize="10.667" FontFamily="Verdana" Foreground="#FF009900" FontWeight="Bold">

        </Button>

        <TextBox x:Name="txtboxSearch" Margin="0,20,148,0" VerticalAlignment="Top" Text="Search" TextWrapping="Wrap"   FontSize="10.667" FontFamily="Verdana" Foreground="#FF009900" FontWeight="Bold" BorderThickness="0" HorizontalAlignment="Right" />

        <TextBox x:Name="txtboxSearchInput" HorizontalAlignment="Right" Margin="0,45,105,0" Width="90" VerticalAlignment="Top" Text="" TextWrapping="Wrap"/>

        <Button x:Name="btnSearch" HorizontalAlignment="Right"  Margin="0,45,15,0" VerticalAlignment="Top" Width="85" Content="Search" Background="#FF009900" BorderThickness="0" />

        <Button HorizontalAlignment="Left" x:Name="btnMyPreferencesImg"  Margin="40,115,0,0" VerticalAlignment="Top" Width="31" Height="30" Click="btnMyPreferences_Click" Background="Transparent" BorderThickness="0">

            <Image Source="Images/Edit.PNG"></Image>

        </Button>

        <TextBox x:Name="txtboxMyPreferences" HorizontalAlignment="Left" Margin="74,120,0,0" VerticalAlignment="Top" Text="My Preferences" TextWrapping="Wrap"   FontSize="10.667" FontFamily="Verdana" Foreground="#FF009900" FontWeight="Bold" BorderThickness="0" />

        <Button HorizontalAlignment="Right" x:Name="btnExportMitigationEventsImg"  Margin="350,115,400,0" VerticalAlignment="Top" Width="30" Height="30" Background="Transparent">

        </Button>

        <Button HorizontalAlignment="Right" x:Name="btnExportMitigationEvents" Content="Export Mitigation Events"  Margin="380,120,220,0" VerticalAlignment="Top" Width="160" Height="20" BorderThickness="0" Background="Transparent" BorderBrush="Transparent" FontSize="10.667" FontFamily="Verdana" Foreground="#FF009900" FontWeight="Bold">

        </Button>

        <Button HorizontalAlignment="Right" x:Name="btnClearFiltersImg"  Margin="570,115,140,0" VerticalAlignment="Top" Width="30" Height="30" Background="Transparent">

        </Button>

        <Button HorizontalAlignment="Right" x:Name="btnClearColumnFilters" Content="Clear Column Filters"  Margin="600,120,0,0" VerticalAlignment="Top" Width="140" Height="20" BorderThickness="0" Background="Transparent" BorderBrush="Transparent" FontSize="10.667" FontFamily="Verdana" Foreground="#FF009900" FontWeight="Bold">

        </Button>

        <StackPanel Margin="0,160,0,0">

            <telerikNavigation:RadTabControl x:Name="radtabMitigationEvents" Width="330" SelectionChanged="radtabMitigationEvents_SelectionChanged" HorizontalAlignment="Left" Margin="0,0,0,0" BorderThickness="0">

                <telerikNavigation:RadTabItem x:Name="radtabitemInbox" Header="Inbox" TabIndex="0"  Height="20" Width="165" IsSelected="False"/>

                <telerikNavigation:RadTabItem x:Name="radtabitemAllMitigations" Header="All Mitigations" TabIndex="1" Height="20" Width="165"/>

            </telerikNavigation:RadTabControl>

            <ScrollViewer HorizontalScrollBarVisibility="Visible">

                <telerikGrid:RadGridView x:Name="rdgMitigationEvents" UseAlternateRowStyle="True" AutoGenerateColumns="False" MultipleSelect="True" Margin="0,0,0,0" Height="380" FontFamily="Verdana">

                    <telerikGrid:RadGridView.Columns>

                        <telerikGrid:GridViewColumn  HeaderText="Select" x:Name="chkboxSelectCol">

                            <telerikGrid:GridViewColumn.CellStyle>

                                <Style TargetType="telerikGridView:GridViewCell">

                                    <Setter Property="Template">

                                        <Setter.Value>

                                            <ControlTemplate TargetType="telerikGridView:GridViewCell">

                                                <Border Padding="5,0,5,0" BorderThickness="0,0,1,1" BorderBrush="#FFB3B3B3">

                                                    <CheckBox HorizontalAlignment="Center" VerticalAlignment="Center"/>

                                                </Border>

                                            </ControlTemplate>

                                        </Setter.Value>

                                    </Setter>

                                </Style>

                            </telerikGrid:GridViewColumn.CellStyle>

                        </telerikGrid:GridViewColumn>

                        <telerikGrid:GridViewColumn Header="Edit" x:Name="imgEditCol">

                            <telerikGrid:GridViewColumn.CellTemplate>

                                <DataTemplate>

                                    <Button Height="20" Width="40" BorderThickness="0" Background="Transparent">

                                        <Image x:Name="imgEdit" Source="Images/Edit.PNG" Height="20" Width="40"/>

                                    </Button>

                                </DataTemplate>

                            </telerikGrid:GridViewColumn.CellTemplate>

                        </telerikGrid:GridViewColumn>

                        <telerikGrid:GridViewColumn Header="Delete" x:Name="imgDeleteCol">

                            <telerikGrid:GridViewColumn.CellTemplate>

                                <DataTemplate>

                                    <Button Height="20" Width="40" BorderThickness="0" Background="Transparent">

                                        <Image Source="Images/Delete.PNG" Height="20" Width="40"/>

                                    </Button>

                                </DataTemplate>

                            </telerikGrid:GridViewColumn.CellTemplate>

                        </telerikGrid:GridViewColumn>

                        <!--Boarding-->

                        <telerikGrid:GridViewDataColumn HeaderText="CreatedBy" x:Name="CreatedBy" UniqueName="CreatedBy" IsGroupable="True" IsFilterable="True"  IsSortable="True"  DataMemberBinding="{Binding inbox_AllMitigationsBDO.BoardingBDO.CreatedBy}" Width="*">

                            <telerikGrid:GridViewDataColumn.CellTemplate>

                                <DataTemplate>

                                    <TextBlock Text="{Binding BoardingBDO.CreatedBy}" />

                                </DataTemplate>

                            </telerikGrid:GridViewDataColumn.CellTemplate>

                            <telerikGrid:GridViewDataColumn.CellEditTemplate>

                                <DataTemplate>

                                    <TextBox Text="{Binding BoardingBDO.CreatedBy, Mode=TwoWay}" />

                                </DataTemplate>

                            </telerikGrid:GridViewDataColumn.CellEditTemplate>

                        </telerikGrid:GridViewDataColumn>

 

                        <telerikGrid:GridViewDataColumn HeaderText="Created Date" DataMemberBinding="{Binding

...

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 06 Oct 2009, 06:10 AM
Hi,

Any more info about your version of the grid will be appreciated. Can you post also more info about your collection of business objects and how the grid is bound in your case?

All the best,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Deepak Garla
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or