locked
Filter on Date column RRS feed

  • Question

  • User1632876415 posted
    So many examples on Filtering in Dynamic Data and no one good with filtering column with DateTime type. How can I use standart feachures of DD or (DD Future project) to build filter on some Date column with simple textbox + AjaxCalendar? I saw Filter repeater control by jheyse, but he use standart calendar control and it use too many place on the page... I whould like to use DD Filters solution.
    Thursday, November 27, 2008 3:41 PM

Answers

  • User-330204900 posted

    It is possible I used the Integer filter from DD Futures  as an FilterAnyColumn Filter see here Part 2 - Create the AnyColumn filter from the Dynamic Data Futures Integer filter. So I guess you could easily modify that and make it into a Date Filter, in fact I think I'll make one using the Calendar Extender from the AJAX control toolkit and do an article on my blog [;)]

    Bear in mind that the standard filters (DD futures) only support = not >, < etc for that you would need something like Jheyes's DynamicDataFiltering here on codeplex.

    Hope this helps [:D]

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, November 27, 2008 6:07 PM

All replies

  • User-330204900 posted

    It is possible I used the Integer filter from DD Futures  as an FilterAnyColumn Filter see here Part 2 - Create the AnyColumn filter from the Dynamic Data Futures Integer filter. So I guess you could easily modify that and make it into a Date Filter, in fact I think I'll make one using the Calendar Extender from the AJAX control toolkit and do an article on my blog [;)]

    Bear in mind that the standard filters (DD futures) only support = not >, < etc for that you would need something like Jheyes's DynamicDataFiltering here on codeplex.

    Hope this helps [:D]

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, November 27, 2008 6:07 PM
  • User-330204900 posted

    In fact this thread here Extended Dynamic Data Filtering by jheyse covers DynamicDataFiltering [:D]

    Thursday, November 27, 2008 6:16 PM
  • User1632876415 posted

    It is possible I used the Integer filter from DD Futures  as an FilterAnyColumn Filter see here Part 2 - Create the AnyColumn filter from the Dynamic Data Futures Integer filter.
     

    Thank U, Stephen for answer. But with Integer filter there is too many values in dropdown combo so with database growing it will be slow solution.

    But I will try to modify Integer Filter code for my needs and will be waiting your version on your blog (one of my favorite) [;)].

    Friday, November 28, 2008 12:40 AM
  • User-330204900 posted

    Have you had a look at DynamicDataFiltering? If you download the Source code you also get a sample website based on AdventureWorks db so you can see how to use the new filtering ability.

    Friday, November 28, 2008 3:28 AM
  • User1632876415 posted

    So I guess you could easily modify that and make it into a Date Filter

    Here is my code:

    I have maked new file Date filter control

    1    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="Date.ascx.cs" Inherits="AsupTasks.Date_Filter" %>
    2    
    3    <asp:TextBox ID="TextBox1" runat="server" CssClass="droplist" AutoPostBack="True"></asp:TextBox> 
    4    <ajaxToolkit:CalendarExtender ID="defaultCalendarExtender" runat="server" TargetControlID="TextBox1" Format="dd.MM.yyyy"/>
    
    1    using System.Web.DynamicData;
    2    
    3    namespace AsupTasks {
    4        public partial class Date_Filter : FilterUserControlBase {
    5    
    6            public override string SelectedValue
    7            {
    8                get
    9                {
    10                   return TextBox1.Text;
    11               }
    12           }
    13       }
    14   }
    It's worked as I expected but may be somebody take to test and add something else.
    
     

    Friday, November 28, 2008 3:30 AM
  • User-330204900 posted

    Thats excelent I'll give it a try this morning. [:D]

    Friday, November 28, 2008 4:59 AM