M
meska
Hi all,
Scenario:
I have a MonthCalendar control, and DataGridView. Depending on dates
displayed in MonthCalendar I want to update information from database.
The Possible Solution:
So I must use DateChanged and/or DateSelected events to get the new dates
and update info from the database. Let’s say the implementation is simple:
in these events I call a function passing the SelectionStart and
SelectionEnd which updates the database.
The problem:
Let's say I use DateChanged event. If user uses the navigation buttons and
navigates from one month to other, the DateChanged event is fired two times
(in our scenario - two calls to the database)
If the user decides to select dates with the mouse by simply dragging
through them. Let's say he starts at 05.15 and ends at 05.19 day. DataChange
event is fired 5 times (in our scenario - five calls to the database)
So we are wasting database resources.
If I try to use the DateSelected event, things are better, the event is
fired one time if the date is selected, but event isn't fired at all if user
uses buttons for navigation
Any ideas?
Scenario:
I have a MonthCalendar control, and DataGridView. Depending on dates
displayed in MonthCalendar I want to update information from database.
The Possible Solution:
So I must use DateChanged and/or DateSelected events to get the new dates
and update info from the database. Let’s say the implementation is simple:
in these events I call a function passing the SelectionStart and
SelectionEnd which updates the database.
The problem:
Let's say I use DateChanged event. If user uses the navigation buttons and
navigates from one month to other, the DateChanged event is fired two times
(in our scenario - two calls to the database)
If the user decides to select dates with the mouse by simply dragging
through them. Let's say he starts at 05.15 and ends at 05.19 day. DataChange
event is fired 5 times (in our scenario - five calls to the database)
So we are wasting database resources.
If I try to use the DateSelected event, things are better, the event is
fired one time if the date is selected, but event isn't fired at all if user
uses buttons for navigation
Any ideas?