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

Gridview Filter

0 Answers 86 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Parthiv
Top achievements
Rank 1
Parthiv asked on 11 May 2011, 12:01 PM
hello
i am face one problem regarding gridview filter
in my gridview columns are dynamically added from code behind 

<grid:RadGridView x:Name="FormsGrid" 
    Margin="5,0,10,0" 
    CanUserFreezeColumns="False"  
    AutoGenerateColumns="False"   
    ScrollMode="RealTime" 
    MinHeight="300"   
    BorderThickness="1,6,1,1" 
    telerik:StyleManager.Theme="Office_Blue" 
    ScrollViewer.HorizontalScrollBarVisibility="Visible"  
    ItemsSource="{Binding PagedSource, ElementName=radDataPager1}"  
    ScrollViewer.VerticalScrollBarVisibility="Auto" 
    SelectionChanged="FormsGrid_SelectionChanged" 
    DataLoaded="FormsGrid_DataLoaded"     
    LayoutUpdated="FormsGrid_LayoutUpdated" 
    CanUserDeleteRows="False" 
    CanUserInsertRows="False"
    IsFilteringAllowed="True">
</grid:RadGridView>
  Code Behind file
FormsGrid.Columns.Clear();
FormsGrid.AutoGenerateColumns = false;
for (int i = 0; i < columnCount; i++)
{
    XElement element = myDoc.Element("NewDataSet").Element("Table").Elements().ElementAt(i);
  
    dgtc = new GridViewDataColumn();
    dgtc.MinWidth = 100;
    dgtc.IsReadOnly = true;
    dgtc.Width = GridViewLength.SizeToHeader;
  
    dgtc.Header = element.Name.ToString().Replace("_x0020_", " ").Replace("_x0028_", " (").Replace("_x0029_", ") ");
  
    dgtc.DataMemberBinding = new Binding(element.Name.ToString().Replace("-", " "));
    dgtc.DataMemberBinding.Source = element.Name;
  
    indexingConverter convert = new indexingConverter();
    Binding bind = new Binding { Converter = convert, ConverterParameter = element.Name };
  
    dgtc.DataMemberBinding = bind;
    dgtc.IsFilterable = true;
    FormsGrid.Columns.Add(dgtc);
}

in code i am set a column's IsFilterable = true
but filter icon not shown in gridview

No answers yet. Maybe you can help?

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