I have a page with essentially three user controls:
1) Contains only a listbox for selection of a location
2) Contains only a date picker.
3) Contains a grid which dynamically changes based on the selections above.
For the date picker we're limiting selection to the "first" day of the week, which may be different depending on the location. The styling of the first day is different than other days so users know what can be clicked. So there is an event attached to 4-5 dates per month, and some custom styling.
If date selection is limited to something like 2 months back and 1 month forward, the unique styling is limited, so the control weighs in at only about 11k. Recently the client asked to allow selection to go back up to one year back and any time in the future. After this change the control consumed close to 7MB and overall app performance tanked. The client is now reconsidering whether that's a "nice to have" feature or a real requirement. I suspect they will prefer better performance over a long-term date selection.
But I'd like to work out the best way to approach this. I'm thinking I can limit the control to a few months back and forward, and when they click on Previous or Next outside of the current scope, I can use code behind to regenerate the control with a wider range in the chosen direction. But that requires more postbacks and that itself will affect performance.
So is there an elegant way to go about managing this? What about some in-depth detail on doing this on the client side? Is this a good application for some rigorous JavaScript?
Another thing I'm thinking is that for this specific application we don't really need to see every day of every week, since they can only select one day from any week. Can we limit the number of days displayed in the calendar control, or might I need to create/find a custom control that elegantly renders only the first day of every week?
Thanks!
1) Contains only a listbox for selection of a location
2) Contains only a date picker.
3) Contains a grid which dynamically changes based on the selections above.
For the date picker we're limiting selection to the "first" day of the week, which may be different depending on the location. The styling of the first day is different than other days so users know what can be clicked. So there is an event attached to 4-5 dates per month, and some custom styling.
If date selection is limited to something like 2 months back and 1 month forward, the unique styling is limited, so the control weighs in at only about 11k. Recently the client asked to allow selection to go back up to one year back and any time in the future. After this change the control consumed close to 7MB and overall app performance tanked. The client is now reconsidering whether that's a "nice to have" feature or a real requirement. I suspect they will prefer better performance over a long-term date selection.
But I'd like to work out the best way to approach this. I'm thinking I can limit the control to a few months back and forward, and when they click on Previous or Next outside of the current scope, I can use code behind to regenerate the control with a wider range in the chosen direction. But that requires more postbacks and that itself will affect performance.
So is there an elegant way to go about managing this? What about some in-depth detail on doing this on the client side? Is this a good application for some rigorous JavaScript?
Another thing I'm thinking is that for this specific application we don't really need to see every day of every week, since they can only select one day from any week. Can we limit the number of days displayed in the calendar control, or might I need to create/find a custom control that elegantly renders only the first day of every week?
Thanks!