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

Discussion in 'ASP .Net Web Controls' started by Keith-Earl, Oct 22, 2004.

  1. Keith-Earl

    Keith-Earl Guest

    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
    Keith-Earl, Oct 22, 2004
    #1
    1. Advertising

  2. Keith-Earl

    rc Guest

    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:%...
    > 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
    >
    >
    rc, Oct 23, 2004
    #2
    1. Advertising

  3. 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" <> wrote in message
    news:...
    > 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:%...
    >> 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
    >>
    >>

    >
    >
    Keith A. Rowe, Oct 25, 2004
    #3
  4. Keith-Earl

    Keith-Earl Guest

    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" <> wrote in message
    news:...
    > 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" <> wrote in message
    > news:...
    >> 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:%...
    >>> 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
    >>>
    >>>

    >>
    >>

    >
    >
    Keith-Earl, Oct 26, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. S. Justin Gengo
    Replies:
    0
    Views:
    523
    S. Justin Gengo
    Jul 16, 2003
  2. Andy
    Replies:
    1
    Views:
    705
  3. Replies:
    2
    Views:
    275
  4. Parthiv Joshi
    Replies:
    1
    Views:
    669
    Samuel L Matzen
    Jul 6, 2004
  5. Alex  Lee

    google calendar -- popup textbox entry

    Alex Lee, Jun 22, 2006, in forum: Javascript
    Replies:
    2
    Views:
    186
    Alex Lee
    Jun 22, 2006
Loading...

Share This Page