Filter Data Grid With calendar control

J

Joey Durham

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
 
D

David Waz...

looks like you forgot to define your datasource:

dgEventList.DataSource = o_DataTable.DefaultView
dgEventList.DataBind

g.l.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top