Filter Data Grid With calendar control

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Filter Data Grid With calendar control

    Hi,

    Hope this is the correct forum to post in. I am new to ASP.NET. I have a
    calendar control that I am using to select a date and then that date will
    list all records that match the date selected in a datagrid. I have
    everything set up but I am unable to get any records to show up. .NET still
    has me a bit puzzled.

    Here is the code I have on my code behind page and my sql statement. Any
    help greatly appreciated.

    Thanks.
    Joey Durham
    [url]www.ultraweaver.com[/url]

    SQL
    SELECT
    EndDate,
    EventID,
    EventName,
    EventTypeID,
    StartDate
    FROM
    Events
    WHERE
    (StartDate = @calStartDate)

    CODE BEHIND
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles MyBase.Load

    'Put user code to initialize the page here

    daEmployeeList.Fill(DsEmployeeList)

    If IsPostBack Then

    dgEventList.DataBind()

    ddlEmployees.DataBind()

    txtStartDate.Text = calStartDate.SelectedDate.ToShortDateString

    txtEndDate.Text = calEndDate.SelectedDate.ToShortDateString

    End If

    End Sub

    Private Sub calStartDate_SelectionChanged(ByVal sender As Object, ByVal e As
    System.EventArgs) Handles calStartDate.SelectionChanged

    txtStartDate.Text = calStartDate.SelectedDate.ToShortDateString

    End Sub

    Private Sub calEndDate_SelectionChanged(ByVal sender As Object, ByVal e As
    System.EventArgs) Handles calEndDate.SelectionChanged

    txtEndDate.Text = calEndDate.SelectedDate.ToShortDateString


    Joey Durham Guest

  2. Similar Questions and Discussions

    1. Data Grid Control no of roxcount
      hi , want to know the rowcount of the datagrid control at runtime so that i can request for that many values.. However on creation complete...
    2. Data Grid Header Filter Renderer or how do I get aheader to filter the data in a datagrid.
      Okay so on the same theme as why isn't the datagrid like Excel, I have created a (very cool) Filter header. 1) The filter looks like any other...
    3. Help looping over data, output grid for a calendar
      I'm trying to build a calendar and want to output days of the week 1-31...few questions...are there date functions to get days of the week, names,...
    4. Data grid control limitation
      Hi Folks, My Situation(program requirement): I have datalist control and having Datagrid inside each ItemTemplate column of datalist control.I...
    5. Need data grid control
      I use a ComponentOne vsFlex grid (unbound) for something very similar. Users can click and drag to mark blocks of time in 15 minutes slots. In...
  3. #2

    Default Re: Filter Data Grid With calendar control

    looks like you forgot to define your datasource:

    dgEventList.DataSource = o_DataTable.DefaultView
    dgEventList.DataBind

    g.l.

    "Joey Durham" <joey@ultraweaver.com> wrote in message
    news:eEVB47zQDHA.4024@tk2msftngp13.phx.gbl...
    > Hi,
    >
    > Hope this is the correct forum to post in. I am new to ASP.NET. I have a
    > calendar control that I am using to select a date and then that date will
    > list all records that match the date selected in a datagrid. I have
    > everything set up but I am unable to get any records to show up. .NET
    still
    > has me a bit puzzled.
    >
    > Here is the code I have on my code behind page and my sql statement. Any
    > help greatly appreciated.
    >
    > Thanks.
    > Joey Durham
    > [url]www.ultraweaver.com[/url]
    >
    > SQL
    > SELECT
    > EndDate,
    > EventID,
    > EventName,
    > EventTypeID,
    > StartDate
    > FROM
    > Events
    > WHERE
    > (StartDate = @calStartDate)
    >
    > CODE BEHIND
    > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
    > System.EventArgs) Handles MyBase.Load
    >
    > 'Put user code to initialize the page here
    >
    > daEmployeeList.Fill(DsEmployeeList)
    >
    > If IsPostBack Then
    >
    > dgEventList.DataBind()
    >
    > ddlEmployees.DataBind()
    >
    > txtStartDate.Text = calStartDate.SelectedDate.ToShortDateString
    >
    > txtEndDate.Text = calEndDate.SelectedDate.ToShortDateString
    >
    > End If
    >
    > End Sub
    >
    > Private Sub calStartDate_SelectionChanged(ByVal sender As Object, ByVal e
    As
    > System.EventArgs) Handles calStartDate.SelectionChanged
    >
    > txtStartDate.Text = calStartDate.SelectedDate.ToShortDateString
    >
    > End Sub
    >
    > Private Sub calEndDate_SelectionChanged(ByVal sender As Object, ByVal e As
    > System.EventArgs) Handles calEndDate.SelectionChanged
    >
    > txtEndDate.Text = calEndDate.SelectedDate.ToShortDateString
    >
    >

    David Waz... Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139