Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Calendar control - adding a textbox on each day for data entry

Reply
Thread Tools

Calendar control - adding a textbox on each day for data entry

 
 
Keith-Earl
Guest
Posts: n/a
 
      10-22-2004
Is it feasible to add a simple textbox into the cell (day) of a calendar
control? How would I add it? access it once the user hit Submit?

I searched google with ".net calendar control data entry" and got lots of
but none allowed for data entry from within the cell.

Thanks,

Keith


 
Reply With Quote
 
 
 
 
rc
Guest
Posts: n/a
 
      10-23-2004
Hello,



I am currently working on a project that needs similar capability.



Here is how I accomplished the first part:





Sub Calendar_RenderDay(s as object, e as DayRenderEventArgs)

dim lb=new label()
dim tb=new TextBox()

lb.text="<center><b>" & Day(e.day.date) & "</b><BR>"

tb.id="Day" & Day(e.day.date)
tb.columns="2"
tb.maxlength="3"

e.Cell.Controls.Clear()
e.Cell.Controls.Add(lb)
e.Cell.Controls.Add(tb)

end sub





This, of course, runs from the RenderDay method of the Calendar control.





The second part, I'm still working on. I believe it will entail somehow
using the FindControl function.



I have not quite figured it out yet.



Hope this helps.






"Keith-Earl" <css@NO_SPAMConsultWithUs.com> wrote in message
news:%(E-Mail Removed)...
> Is it feasible to add a simple textbox into the cell (day) of a calendar
> control? How would I add it? access it once the user hit Submit?
>
> I searched google with ".net calendar control data entry" and got lots of
> but none allowed for data entry from within the cell.
>
> Thanks,
>
> Keith
>
>



 
Reply With Quote
 
 
 
 
Keith A. Rowe
Guest
Posts: n/a
 
      10-25-2004
RC,

I figured out the first part, just need to figure out how to iterate through
each day (cell) once a submit button is pushed. We could use the
button_clicked event, just how to iterate thru the cells.

Thanks,
Keith


"rc" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello,
>
>
>
> I am currently working on a project that needs similar capability.
>
>
>
> Here is how I accomplished the first part:
>
>
>
>
>
> Sub Calendar_RenderDay(s as object, e as DayRenderEventArgs)
>
> dim lb=new label()
> dim tb=new TextBox()
>
> lb.text="<center><b>" & Day(e.day.date) & "</b><BR>"
>
> tb.id="Day" & Day(e.day.date)
> tb.columns="2"
> tb.maxlength="3"
>
> e.Cell.Controls.Clear()
> e.Cell.Controls.Add(lb)
> e.Cell.Controls.Add(tb)
>
> end sub
>
>
>
>
>
> This, of course, runs from the RenderDay method of the Calendar control.
>
>
>
>
>
> The second part, I'm still working on. I believe it will entail somehow
> using the FindControl function.
>
>
>
> I have not quite figured it out yet.
>
>
>
> Hope this helps.
>
>
>
>
>
>
> "Keith-Earl" <css@NO_SPAMConsultWithUs.com> wrote in message
> news:%(E-Mail Removed)...
>> Is it feasible to add a simple textbox into the cell (day) of a calendar
>> control? How would I add it? access it once the user hit Submit?
>>
>> I searched google with ".net calendar control data entry" and got lots of
>> but none allowed for data entry from within the cell.
>>
>> Thanks,
>>
>> Keith
>>
>>

>
>



 
Reply With Quote
 
Keith-Earl
Guest
Posts: n/a
 
      10-26-2004
I figured it out!

You have to assign an ID to the text box and also add a hidden text box that
contains the date. Assign an ID to the hidden field as well. Make sure you
wrap the Calendar in <form> tags.

The POST will create an array of controls for you, each named the same,
but you can put it in an array and process them. I will post the code if
you like.

Keith



"Keith A. Rowe" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> RC,
>
> I figured out the first part, just need to figure out how to iterate
> through each day (cell) once a submit button is pushed. We could use the
> button_clicked event, just how to iterate thru the cells.
>
> Thanks,
> Keith
>
>
> "rc" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Hello,
>>
>>
>>
>> I am currently working on a project that needs similar capability.
>>
>>
>>
>> Here is how I accomplished the first part:
>>
>>
>>
>>
>>
>> Sub Calendar_RenderDay(s as object, e as DayRenderEventArgs)
>>
>> dim lb=new label()
>> dim tb=new TextBox()
>>
>> lb.text="<center><b>" & Day(e.day.date) & "</b><BR>"
>>
>> tb.id="Day" & Day(e.day.date)
>> tb.columns="2"
>> tb.maxlength="3"
>>
>> e.Cell.Controls.Clear()
>> e.Cell.Controls.Add(lb)
>> e.Cell.Controls.Add(tb)
>>
>> end sub
>>
>>
>>
>>
>>
>> This, of course, runs from the RenderDay method of the Calendar control.
>>
>>
>>
>>
>>
>> The second part, I'm still working on. I believe it will entail somehow
>> using the FindControl function.
>>
>>
>>
>> I have not quite figured it out yet.
>>
>>
>>
>> Hope this helps.
>>
>>
>>
>>
>>
>>
>> "Keith-Earl" <css@NO_SPAMConsultWithUs.com> wrote in message
>> news:%(E-Mail Removed)...
>>> Is it feasible to add a simple textbox into the cell (day) of a calendar
>>> control? How would I add it? access it once the user hit Submit?
>>>
>>> I searched google with ".net calendar control data entry" and got lots
>>> of
>>> but none allowed for data entry from within the cell.
>>>
>>> Thanks,
>>>
>>> Keith
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calendar yr-mnth-day data to day since data skorpio11@gmail.com Python 2 10-04-2009 12:54 AM
Now.day and day(now) returning the wrong day! Andy ASP .Net 1 11-06-2008 12:20 PM
google calendar -- popup textbox entry Alex Lee Javascript 2 06-22-2006 08:23 PM
How to make a week view and day view calendar just like month view calendar in .NET ? Parthiv Joshi ASP .Net Web Controls 1 07-06-2004 03:15 PM
Re: VERY STRANGE BUG? Adding a textbox control causes other textbox control to fail??? S. Justin Gengo ASP .Net 0 07-16-2003 06:51 PM



Advertisments