15,908,172 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by leptosomic (Top 2 by date)
leptosomic
4-Dec-12 18:51pm
View
And excuse me for not so clear formulation of question and broken language. This is my first post in english, I need more practice :)
leptosomic
4-Dec-12 18:42pm
View
I don't want to select all records from the table. I do GetDisplayRange at start and select dates between beginning and end of range. Indeed, why to select all records, if user can't see all of them in calendar at the moment? And what if there are too much records, how fast will it be? DateChanged doesn't fit, because it fires when user highlights dates, but user can scroll calendar without changing selected date. Assume, calendar displays september, october and november. A day selected in september, then user scrolls calendar to left, now we see august, september and october, and a day selected in september, date hasn't changed. And august haven't any bold dates, because it wasn't included in initial range, and program doesn't know, what it's time to select next portion of dates. Actually I need DisplayRangeChanged event.
May be I should use CalendarDimensions property and SelectionRange instead of GetDisplayRange.
something like this:
monthsDisplayed=CalendarDimensions.Width*CalendarDimensions.Height;
dateStart=SelectionRange.End.AddMonths(-monthsDisplayed);
dateEnd=SelectionRange.Start.AddMonths(monthsDisplayed);
and then select dates from datatable where dates between dateStart and dateEnd and on DateChanged recalculate this diapason and select next portion of data if diapason was increased. Just extending bounds of diapason in both sides such way that in worst case date will change early than user will see empty part of calendar.