Filters not showing with list of objects

1 posts, 0 answers
  1. Ravi Kishore
    Ravi Kishore avatar
    3 posts
    Member since:
    Aug 2012

    Posted 20 Aug 2012 Link to this post

    Hi,
        We are binding a list of objects to gridview and enable filter on couple of columns. Data is collection of two different types of objects (Folder and File). Both Folder and File are having some common properties like Name, Description,... We are showing these common properties in the grid. When ever data having items of two type filter are not showing. If the data contain items of only one type (Either Folder or File) then filter are showing.
    XAML:
    <telerik:RadGridView x:Name="gridView" Visibility="Collapsed"  Margin="0" Grid.Row="2"  AutoGenerateColumns="False" AllowDrop="False" ShowGroupPanel="False" RowIndicatorVisibility="Collapsed"
                                     CanUserDeleteRows="False" CanUserReorderColumns="False" CanUserSortColumns="False" IsFilteringAllowed="True">
                <telerik:RadGridView.Columns>
                    <telerik:GridViewDataColumn IsReadOnly="True" DataMemberBinding="{Binding Name}" Header="Name" Width="450" IsFilterable="True"/>
                    <telerik:GridViewDataColumn IsReadOnly="True" DataMemberBinding="{Binding Description}" Header="Description" Width="*" IsFilterable="True"/>
                </telerik:RadGridView.Columns>
            </telerik:RadGridView>
    CS:
    public class Folder
    {
    public string Name {get; set;};
    public string Description {get;set;}
    public string FolderType{get;set;}
    }
     
    public class File
    {
    public string Name {get; set;};
    public string Description {get;set;}
    public string Extension{get;set;}
    public string MIMEType{get;set;}
    }
     
    List<object> items = GetFolders().toList<object>();
    items.AddRange(GetFiles().toList<object>();
     
    gridView.ItemsSource = items;

    Please help me on this. I am stuck with this from 2 days. Thanks in advance.

    Thanks,
    Ravi Kishore. Ch
Back to Top