[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

C# Script request: using a calendar control in a datalist within EditItemTemplate

Posted on 2005-05-05
6
Medium Priority
?
808 Views
Last Modified: 2008-01-09
I have tried and failed and searched for info on this with no real satisfactory answer.

I need to use a calendar control within the EditItemTemplate of a DataList. I'm keen to avoid a 'pop-up' calendar so prefer it in the page.

The idea is that there is a form with the following elements

1. A text input field for a date
2. Next to this field is a small calendar icon
3. Beneath this is a calendar control with visibility set to false.

The user clicks the calendar icon and the calendar control appears. Then the user clicks a day and the text box is updated with the selected date and the calendar's visibility is set back to false.

This is easy to do normally, but within a datalist I have problems with the control NOT being recognised.
0
Comment
Question by:w3digital
  • 3
  • 3
6 Comments
 
LVL 5

Accepted Solution

by:
ovalsquare earned 1500 total points
ID: 13952197
I always end up using eWorld's Calendar Popup (which is actually not a popup, so don't be mislead by the name). It does exactly what you require and it's wrapped in a nice clean package.

Here's the files and description: http://www.eworldui.net/CustomControls/CalendarPopup.aspx and here's a demo: http://www.eworldui.net/CustomControls/CalendarPopupDemo.aspx

Let me know if you need help dealing with it in a datalist.

Ted
0
 

Author Comment

by:w3digital
ID: 13953100
Thanks Ted. Perfect!
0
 

Author Comment

by:w3digital
ID: 13953129
OK, Ted.

Yes I need help, I've fallen at the first hurdle :(

I've installed but get the error of:  System.Web.UI.HtmlControls.HtmlTableCellCollection must have items of type 'System.Web.UI.HtmlControls.HtmlTableCell'. 'ew:CalendarPopup' is of type 'eWorld.UI.CalendarPopup'.

I've installed to GAC and added a reference to the code behind (if that's what I'm meant to do) and searched for the answer to this in the forums with no help.

Perhaps you could post a small code snippet of how to implement it?

I'd be most grateful.

I notice you answered another post of mine relating to a similar question which this also solves so I've award points there for you too.

Thanks again.

Chris.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Expert Comment

by:ovalsquare
ID: 13954368
You're dealing with adding a collection of table cells programatically, so you need to be placing each control within the appropriate control. Can you post your code so I can take a look at what's missing in your particular case?

Ted
0
 

Author Comment

by:w3digital
ID: 13956017
Thanks for your help Ted.

I rebuilt the page and it was fine. Odd.

I think the calendar control could have used a touch more documentation and a few example scripts but I muddled my way through from a bit of trial and error and the some of the forum posts.

Everything working fine and dandy now.

All the best,

Chris
0
 
LVL 5

Expert Comment

by:ovalsquare
ID: 13956634
Glad it worked out!

Ted
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses
Course of the Month19 days, 11 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question