Ask a Question related to ASP.NET General, Design and Development.
-
Joey Durham #1
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
-
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... -
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... -
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,... -
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... -
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... -
David Waz... #2
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...still> 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. .NETAs> 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> 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



Reply With Quote

