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

[Solved] Column filtering problem

2 Answers 91 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.
Ryan Morgan
Top achievements
Rank 1
Ryan Morgan asked on 04 Oct 2009, 09:01 AM
Filter drop down is empty when I set ItemsSource from xaml.

Here is simplified sample:

 

    public class Item  
    {  
        public string Title  
        {  
            get;  
            set;  
        }  
    }  
 
    public class AppContext  
    {  
        private static AppContext _instance = new AppContext();  
        private ObservableCollection<Item> _items = new ObservableCollection<Item>();  
 
        public static AppContext Instance  
        {  
            get 
            {  
                return _instance;  
            }  
        }  
 
        public ObservableCollection<Item> Items  
        {  
            get 
            {  
                _items.Add(new Item() { Title = "New Item" });  
                return _items;  
            }  
            set 
            {  
                _items = value;  
            }  
        }  
    } 

Startup page xaml:

<UserControl x:Class="SilverlightApplication1.MainPage" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"   
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:SilverlightApplication1" 
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"   
             xmlns:grid="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" 
    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">  
      
    <UserControl.Resources> 
        <local:AppContext x:Key="AppContext"/>  
    </UserControl.Resources> 
      
  <Grid x:Name="LayoutRoot">  
        <grid:RadGridView x:Name="radGrid" AutoGenerateColumns="False" ItemsSource="{Binding Items, Source={StaticResource AppContext}}">  
            <grid:RadGridView.Columns> 
                <grid:GridViewDataColumn Header="Title" DataMemberBinding="{Binding Title}"/>  
            </grid:RadGridView.Columns> 
        </grid:RadGridView> 
  </Grid> 
</UserControl> 

2 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 05 Oct 2009, 07:13 AM
Hello Ryan,

Do you have our latest version? I've tried your scenario however everything worked fine on my end - you can check the attached application for more info.

Best wishes,
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.
0
Ryan Morgan
Top achievements
Rank 1
answered on 05 Oct 2009, 09:33 AM
Hi Vlad,

Thanks, for your feedback.

Version i'm using is Q2 SP1.
But I tried Q3 beta and it works fine. Seems it is already fixed in the latest.

Thanks, Ryan
Tags
GridView
Asked by
Ryan Morgan
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Ryan Morgan
Top achievements
Rank 1
Share this question
or