Filter Data Grid With calendar control

Discussion in 'ASP .Net' started by Joey Durham, Jul 5, 2003.

  1. Joey Durham

    Joey Durham Guest

    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
    www.ultraweaver.com

    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, Jul 5, 2003
    #1
    1. Advertising

  2. Joey Durham

    David Waz... Guest

    looks like you forgot to define your datasource:

    dgEventList.DataSource = o_DataTable.DefaultView
    dgEventList.DataBind

    g.l.

    "Joey Durham" <> wrote in message
    news:...
    > 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
    > www.ultraweaver.com
    >
    > 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..., Jul 6, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shevek
    Replies:
    3
    Views:
    6,049
    Shevek
    Jun 23, 2004
  2. Nikkie
    Replies:
    0
    Views:
    447
    Nikkie
    Nov 22, 2004
  3. zax75
    Replies:
    1
    Views:
    1,103
  4. Shevek
    Replies:
    0
    Views:
    390
    Shevek
    Jun 23, 2004
  5. angel ko via .NET 247

    How do I handle SelectionChanged event of a calendar in a data grid

    angel ko via .NET 247, Mar 18, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    250
    angel ko via .NET 247
    Mar 18, 2005
Loading...

Share This Page