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

[Solved] Filtering in Grid with AutoPostbackOnFilter Issue

1 Answer 107 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Juan Angel
Top achievements
Rank 1
Veteran
Juan Angel asked on 25 Nov 2009, 04:50 PM
I have a lot of Grids with default filtering: AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"

Using 2009.3.1109.35 RadGrid filtering crash when if any column that AllowFiltering="true" and not set DataField and try filter for any column.

Example:
... 
<Columns> 
<telerik:GridBoundColumn DataField="ID_ENTIDAD" HeaderText="Id." ReadOnly="True" SortExpression="ID_ENTIDAD" FilterControlWidth="50px" 
     AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" ShowFilterIcon="false" >
</telerik:GridBoundColumn> 
<telerik:GridTemplateColumn DataField="DSC_ENTIDAD" HeaderText="Entidad" SortExpression="DSC_ENTIDAD" FilterControlWidth="99%"  
     AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
     .....
</telerik:GridTemplateColumn> 
<telerik:GridTemplateColumn [DataField="BOL_ACTIVO"] DataType="System.Boolean" HeaderText="Activo" SortExpression="BOL_ACTIVO" 
    AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" ShowFilterIcon="false"
.....
</telerik:GridTemplateColumn> 
</column> 

if you forget [DataField="BOL_ACTIVO"]  any filter don't run. Lauch Postback, but OnInit of grid donĀ“t execute.
If you mark this column AllowFiltering="false", all OK.

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 27 Nov 2009, 05:03 PM
Hello Juan,.
 
I believe it is expected to receive an error when you have defined a default filter function and in the same time you don't have a datafield? In other words, you want to filter by column that doesn't support filtering.

Regards,
Daniel
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
Grid
Asked by
Juan Angel
Top achievements
Rank 1
Veteran
Answers by
Daniel
Telerik team
Share this question
or