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

Filtering on tab or lost focus

1 Answer 141 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joseph Baker
Top achievements
Rank 2
Joseph Baker asked on 06 Mar 2009, 04:42 PM
I have a radgrid that uses gridboundcolumns with filtering.  I need to be able to automatically filter "contains" when the user tabs out of the filter box (or focus is lost to the filter box).  I've searched but can't seem to find a solution.  Any help would be greatly appreciated.
Here is the grid, just in case it's needed:
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AllowPaging="True" 
            AllowSorting="True" AutoGenerateColumns="False" DataSourceID="SqlDataRamps" GridLines="None">  
            <PagerStyle Mode="NextPrevNumericAndAdvanced" ShowPagerText="true" /> 
            <MasterTableView DataSourceID="SqlDataRamps" PageSize="15">  
                <RowIndicatorColumn Visible="False">  
                    <HeaderStyle Width="20px"></HeaderStyle> 
                </RowIndicatorColumn> 
                <ExpandCollapseColumn Visible="False" Resizable="False">  
                    <HeaderStyle Width="20px"></HeaderStyle> 
                </ExpandCollapseColumn> 
                <Columns> 
                    <telerik:GridBoundColumn DataField="TRANSFER_POINT_ID" HeaderText="Ramp ID" SortExpression="TRANSFER_POINT_ID" 
                        UniqueName="TRANSFER_POINT_ID" Display="False" Resizable="False">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="NAME" HeaderText="Ramp Name" SortExpression="NAME" 
                        UniqueName="NAME">  
                        <FooterStyle Width="225px" /> 
                        <HeaderStyle Width="225px" /> 
                        <ItemStyle Width="225px" /> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="CITY" HeaderText="City" SortExpression="CITY" 
                        UniqueName="CITY">  
                        <FooterStyle Width="100px" /> 
                        <HeaderStyle Width="100px" /> 
                        <ItemStyle Width="100px" /> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="STATE" HeaderText="State" SortExpression="STATE" 
                        UniqueName="STATE">  
                        <FooterStyle Width="50px" /> 
                        <HeaderStyle Width="50px" /> 
                        <ItemStyle Width="50px" /> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="STATION_CODE" HeaderText="Station" SortExpression="STATION_CODE" 
                        UniqueName="STATION_CODE">  
                        <FooterStyle Width="50px" /> 
                        <HeaderStyle Width="50px" /> 
                        <ItemStyle Width="50px" /> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="CARRIER_NAME" HeaderText="Carrier" SortExpression="CARRIER_NAME" 
                        UniqueName="CARRIER_NAME">  
                        <FooterStyle Width="225px" /> 
                        <HeaderStyle Width="225px" /> 
                        <ItemStyle Width="225px" /> 
                    </telerik:GridBoundColumn> 
                </Columns> 
                <EditFormSettings> 
                    <PopUpSettings ScrollBars="None"></PopUpSettings> 
                </EditFormSettings> 
            </MasterTableView> 
            <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True">  
                <Selecting AllowRowSelect="True" /> 
                <ClientEvents OnRowSelected="RowSelected" OnRowDblClick="RowDblClick" /> 
            </ClientSettings> 
        </telerik:RadGrid> 



1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 09 Mar 2009, 07:41 AM
Hi Joseph,

Set the AutoPostBackOnFilter  property to true for the Grid column. And also set the CurrentFilterFunction to Contains to achieve the desired scenario.
Search on key press/button click

Thanks
Shinu.



Tags
Grid
Asked by
Joseph Baker
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Share this question
or