How can you tell if a (Calendar) WebControl has focus

P

Peter

I have a page that has multiple calendars on it and sync off of the DayRendered event
on each control. My problem is that if a user clicks on one calendar, it causes a
refresh and kicks off all the DayRendered events on my page. I want to ignore that
if event if the keyclick wasn't on my custom calendar. Is there a way to get which
control has the focus? From what I read the only way is through JavaScript????

BTW, I can't use the SelectionChanged event because I could have situations where
the user could click on the same date twice....
 
J

Joshua Mitts

I understand your question, but not why SelectionChanged won't work...it
seems to be just what you need, right? If the date doesn't change, then why
update the other calendars?

--

Joshua Mitts
(e-mail address removed)

I have a page that has multiple calendars on it and sync off of the
DayRendered event
on each control. My problem is that if a user clicks on one calendar, it
causes a
refresh and kicks off all the DayRendered events on my page. I want to
ignore that
if event if the keyclick wasn't on my custom calendar. Is there a way to get
which
control has the focus? From what I read the only way is through
JavaScript????

BTW, I can't use the SelectionChanged event because I could have situations
where
the user could click on the same date twice....
 
P

Peter

I had the same thought but as you know the SelectionChanged event won't get
called
if you click on the same date. So that's why I am using the DayRendered
event.
The reason I want to monitor whether a user clicks on the same date
consecutively
is that I highlight/select the date on alternating clicks (like an on off
switch). This way
they can have the ability to select or deselect the usage of the date. The
fly in the
ointment is when I have multiple calendars on the same page and the
selection of a
date causes a reload which kicks off all the DayRendered events for all the
calendars
on the page.... Is there anyway to know what control caused the page reload?
Perhaps when page_load gets called I can somehow at that point store in a
session
variable the UniqueID of the control????
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top