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

Filter options on GridNumericColumn and GridDateTimeColumn columns

5 Answers 274 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Phil
Top achievements
Rank 1
Phil asked on 27 May 2014, 11:49 AM
I am using v2014.1.403.45 of the ASP Ajax controls and was looking at implementing a Between and Not Between filter on my columns, the problem is the default implementation does not appear to support this functionality.

I know I can use the GridBoundColumn and use the DataType property to implement these filters but I also lose the formatting on the edit / insert, such as only allowing numeric entry in a GridNumericColumn. Is there a way to implement these additional search criteria use GridNumericColumn and GridDateTimeColumn?

Here is my current implementation.

<telerik:RadGrid ID="RadGrid1" runat="server" OnPreRender="RadGrid1_PreRender" AutoGenerateColumns="False" PagerStyle-Position="Bottom" PageSize="20" 
                     EnableLinqExpressions="False" AllowPaging="True" AllowSorting="True" GridLines="None" ShowGroupPanel="True" Skin="WebBlue" 
                     DataSourceID="SqlDataSource1" OnItemDataBound="RadGrid1_ItemDataBound">

    <MasterTableView EditMode="PopUp" AllowFilteringByColumn="true" CommandItemDisplay="Top" AllowMultiColumnSorting="true">

        <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>

            <Columns>

                <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn" />

                <telerik:GridBoundColumn DataField="ReportKey" FilterControlAltText="Filter ReportKey column" HeaderText="ReportKey"
                                            SortExpression="ReportKey" UniqueName="ReportKey">
                    <FilterTemplate>
                        <telerik:RadComboBox ID="RadComboBoxReportKey" DataSourceID="SqlDataSource2" DataTextField="ReportKey" DataValueField="ReportKey" 
                                                AppendDataBoundItems="true" CheckBoxes="true" runat="server" EmptyMessage="Select Report Key's">
                        </telerik:RadComboBox>
                        <asp:ImageButton ID="SearchButton" runat="server" AlternateText="Filter" ToolTip="Filter by Report Key's" 
                                            OnClick="SearchButton_Click" ImageUrl="~/search.png" />
                    </FilterTemplate>
                </telerik:GridBoundColumn>
                

                <telerik:GridNumericColumn DataField="PrepTime" AllowFiltering="true" HeaderText="PrepTime"
                    SortExpression="PrepTime" UniqueName="PrepTime">
                </telerik:GridNumericColumn>

                <telerik:GridNumericColumn DataField="TravelTime" AllowFiltering="true" HeaderText="TravelTime"
                    SortExpression="TravelTime" UniqueName="TravelTime">
                </telerik:GridNumericColumn>

                <telerik:GridNumericColumn DataField="VisitTime" AllowFiltering="true" HeaderText="VisitTime"
                    SortExpression="VisitTime" UniqueName="VisitTime">
                </telerik:GridNumericColumn>

                <telerik:GridCheckBoxColumn DataField="IsVerified" AllowFiltering="true" HeaderText="IsVerified"
                    SortExpression="IsVerified" UniqueName="IsVerified">
                </telerik:GridCheckBoxColumn>

                <telerik:GridCheckBoxColumn  DataField="IsDeleted" AllowFiltering="true" HeaderText="IsDeleted"
                    SortExpression="IsDeleted" UniqueName="IsDeleted">
                </telerik:GridCheckBoxColumn >

                <telerik:GridBoundColumn DataField="LastSavedByUID" AllowFiltering="true" HeaderText="LastSavedByUID"
                    SortExpression="LastSavedByUID" UniqueName="LastSavedByUID">
                </telerik:GridBoundColumn>
            
                <telerik:GridDateTimeColumn DataField="DateLastSaved" AllowFiltering="true" HeaderText="DateLastSaved"
                    SortExpression="DateLastSaved" UniqueName="DateLastSaved">
                </telerik:GridDateTimeColumn>                       

            </Columns>

        <EditFormSettings>
            <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
        </EditFormSettings>

    </MasterTableView>

    <ClientSettings AllowDragToGroup="True">
        <Selecting AllowRowSelect="true" />
    </ClientSettings>

    <FilterMenu EnableImageSprites="False"></FilterMenu>

    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>

</telerik:RadGrid>





5 Answers, 1 is accepted

Sort by
0
Phil
Top achievements
Rank 1
answered on 27 May 2014, 03:28 PM
For the GridDateTimeColumn you can implement the EnableRangeFiltering property http://www.telerik.com/help/aspnet-ajax/grid-rangefiltering-datetime-column.html but this removes the previous filter options.

I would like a method of showing all the filter type.
0
Phil
Top achievements
Rank 1
answered on 29 May 2014, 07:44 AM
Anyone care to comment?
0
Maria Ilieva
Telerik team
answered on 30 May 2014, 09:02 AM
Hi Phil,

Currently the Between and NotBetween filter options are available only for GridBoundColumn and GridDateTimeCoulmn.
I would suggest you to revise the forum thread below which provides more details on this matter:
http://www.telerik.com/forums/numericcolumn-and-between-filter


Regards,
Maria Ilieva
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Phil
Top achievements
Rank 1
answered on 30 May 2014, 10:59 AM
Thanks Maria,

Is there any method to implement my own bespoke Between filter for the Numeric column?
0
Maria Ilieva
Telerik team
answered on 04 Jun 2014, 11:45 AM
Hi Phil,

Currently the only possible approach is to use Bound column. The mentioned functionality could not be implemented for GridNumericColumn.

Regards,
Maria Ilieva
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Phil
Top achievements
Rank 1
Answers by
Phil
Top achievements
Rank 1
Maria Ilieva
Telerik team
Share this question
or