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

Filter Icon

1 Answer 96 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Paul Gallen
Top achievements
Rank 1
Paul Gallen asked on 29 May 2009, 08:46 AM
Hi

Given the code below, when the Grid is rendered, there is no filter icon on the column. Can you tell me what else I need to do to get the filter icon (therefore enabling filtering) to appear on a dynamic column.

 Dim UDFCellStyle As Windows.Style = Me.FindResource("UDFCellViewStyle")  
 
        For Each UDFItem In Me.CMXEvent.UDFItems  
            Dim UDFColumn As New Telerik.Windows.Controls.GridViewDataColumn  
            UDFColumn.CellStyle = UDFCellStyle  
            UDFColumn.HeaderText = UDFItem.UDF.Name  
            UDFColumn.IsFilterable = True 
            UDFColumn.DataContext = UDFItem  
            Me.grdMembers.Columns.Add(UDFColumn)  
 
        Next 


Thanks


P

1 Answer, 1 is accepted

Sort by
0
Stefan Dobrev
Telerik team
answered on 30 May 2009, 07:41 AM
Hello Paul,

You should set DataMemberBinding (or UniqueName) for the generated column in order to bind to a specific property of your data source element. If the specified property is a build-in type (like int, string, etc.) you will be able to filter right now. If your property is a custom object, you should implement IEquatable<> and IComparable<> interfaces in your object in order for the grid to be able to perform the operation.

Hope this helps.

All the best,
Stefan Dobrev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
Paul Gallen
Top achievements
Rank 1
Answers by
Stefan Dobrev
Telerik team
Share this question
or