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

K

Keith-Earl

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
 
R

rc

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.
 
K

Keith A. Rowe

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
 
K

Keith-Earl

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
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top