473,324 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

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
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
Nov 17 '05 #1
1 4230
looks like you forgot to define your datasource:

dgEventList.DataSource = o_DataTable.DefaultView
dgEventList.DataBind

g.l.

"Joey Durham" <jo**@ultraweaver.com> wrote in message
news:eE**************@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
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

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Edward Burns | last post by:
I am trying to create an events calendar with a complete month view. I want to be able to get all the events for a particular month, using only one recordset on the page then be able to loop...
4
by: Nhmiller | last post by:
This is directly from Access' Help: "About designing a query When you open a query in Design view, or open a form, report, or datasheet and show the Advanced Filter/Sort window (Advanced...
0
by: Nikkie | last post by:
Hi, In my asp.net application, I have datagrid control and a calendar control. The grid has a column for dates. All I want is, when I click on a cell in that column, the grid comes into edit...
11
by: Thomas A | last post by:
Hi, I fill a datgrid with data from a xml document, it works fine But.... Now I will to filter the data to the grid so only the data shows from the criteria that I set. My code now is very...
1
by: sg | last post by:
Hi I'm starting programming in visual studio and c# and i have a problem with filtering datagrid. I build form with datagrid and i see data from database. I find in microsoft web page...
1
by: Richard Fagen | last post by:
Hi, What are the best practices to filter a datagrid based on user input? For example: I want to display a grid with rows of sales information and allowed the users to specify options (ex:...
1
by: kithir | last post by:
Hi, I am working with asp.net.In my webform i have an editable datagrid.I am loading data from the database.I want to enter data for the particular column of the grid.But that grid has more than...
0
by: charmidd | last post by:
Does anyone know if it is possible to Drag data from a gridview and drop it in another control. I have a day calendar(ie...outlook's calendar) and I need to drag data from a grid listing into the...
15
by: Gilles Ganault | last post by:
Hello Since Python is such a productive language, I'd really like to be able to use it to write GUI apps for Windows, but business apps require rich widgets like (DB)grids, calendars, etc. ...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.