TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
narasiman rao
NA
519
767.5k
selected date want to display in datagridview using csharp
Feb 20 2013 7:06 AM
Design as follows
Calendar (control name month calendar)
Note: it is windows application.
Run mode as follows;
In the run mode when i select any month and click, that month all dates want to display in dategridview.
My code as follows;
private void Facavailcal_DateChanged(object sender, DateRangeEventArgs e)
{
DateTime dt1 = Facavailcal.TodayDate;
dt1 = new DateTime(dt1.Year, dt1.Month, 1);
DateTime dt2 = dt1.AddMonths(1);
int numDays = (dt2 - dt1).Days;
if (DGVCalendar.RowCount < numDays)
{
DGVCalendar.RowCount = numDays;
}
int row = 0;
while (dt1 < dt2)
{
DGVCalendar.Rows[row].Cells[0].Value = dt1.ToString("dd/MM/yyyy");
dt1 = dt1.AddDays(1);
row++;
}
}
in the above code, in the run mode in the calendar february month is there,when i select the that month all date is display in datagridview.
suppose when i select march month means, that month all date is not display in dategridview.
from my above code what is the problem.
please help me.
Reply
Answers (
1
)
How to convert normal foreach loop into lambda expression?
check selected date in database from the calendar in C#