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
771.7k
date picker foramt to be date and month in DGv month as JAN
Jan 10 2013 6:59 AM
design as follows in data grid view;;
Date Session Column name Column name Column name Column name Column name
18 1 1
18 1 2
18 1 3
18 1 4
in run mode date inpicker format is date, month in data grid view.
month should be character as example jan
Code as follows;
int iRow = 0;
this.datagridView.RowCount = 24;
for (int i = 0; i < 6; i++)
{
DateTime newDate = dt_startweek.Value.AddDays(i);
for (int newIndex = 1; newIndex <= 4; newIndex++)
{
datagridView[0, iRow].Value = newDate.Day.ToString() +"" + newDate.Month.ToString();
datagridView[1,iRow].Value = newIndex.ToString();
iRow = iRow + 1;
}
}
//datagridView[0,iRow].Value = newDate.ToShortDateString().ToString();
for the month code in data grid view mention code as
datagridView[0, iRow].Value = newDate.Day.ToString() +"" + newDate.Month.ToString();
that month shluld be character as jan not '1' in number.
output as follows in run mode in data grid view.the month to be char like Jan
Date Session Column name Column name Column name Column name Column name
18 jan 1
18 jan 2
18 jan 3
18 jan 4
try this
datagridView[0, iRow].Value = newDate.Day.ToString() +"" + newDate.Month.ToString("MMM");
i try your solution above solution but the output shows as
Date Session Column name Column name Column name Column name Column name
18 MMM 1
18 MMM 2
18 MMM 3
18 MMM 4
not shows the correct output .
i want the output as follows;
18 jan 1
18 jan 2
18 jan 3
18 jan 4
Reply
Answers (
1
)
WP7 Isolated Storage : Can't Create Directory
how to merge rows in data grid view in run time