开发者

Filtering radGrid while pressing Enter - Telerik

i am using telerik RadGrid to show a DataTable. I have enabled filtering option. there i am seeing some list of options like "Contains","Starts With","Ends With",....

i need to filter when i press enter from the filter text.

Is there any opti开发者_如何学运维on available in telerik, or how can i do it.


There is, and it is shown on the demos here (see first two columns).

<Columns>
    <telerik:GridMaskedColumn DataField="OrderID" HeaderText="OrderID"
        FilterControlWidth="50px" AutoPostBackOnFilter="false" CurrentFilterFunction="EqualTo"
        FilterDelay="2000" ShowFilterIcon="false" Mask="#####">
    </telerik:GridMaskedColumn>
    <telerik:GridBoundColumn FilterControlWidth="120px" DataField="ShipName" HeaderText="ShipName"
        AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
        ShowFilterIcon="false">
    </telerik:GridBoundColumn>


Two properties you need to set: AutoPostBackOnFilter and CurrentFilterFuction

<telerik:GridBoundColumn 
     AutoPostBackOnFilter="True" 
     DataField="Field" 
     HeaderText="Text" 
     CurrentFilterFunction="Contains" 
     AutoPostBackOnFilter="true"  >
</telerik:GridBoundColumn>


Set AutoPostBackOnFilter="true" on the column

Aspx:

<Columns>
    <telerik:GridBoundColumn 
        AutoPostBackOnFilter="True" 
        DataField="ProductName" 
        HeaderText="Product Name" 
        UniqueName="ProductName" />

    <telerik:GridBoundColumn 
        AutoPostBackOnFilter="True" 
        DataField="Cost" 
        HeaderText="Cost" 
        UniqueName="Cost" />
 </Columns>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜