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
mike Delvotti
NA
262
0
Add entry into datagridview cell based on another cell value
Jun 29 2013 11:52 AM
I'm trying to auto enter todays date in a datagriview cell when a user clicks a value in another cell to "YES"
I'm nearly there but my code below has something stopping it working?
I think it's on this line:
if (content.ToLower().Trim() == "YES")
Below is my example:
if (e.ColumnIndex != 4 || e.ColumnIndex != 4) return;
object obj = suppliersDataGridView.Rows[e.RowIndex].Cells[4].Value;
if (obj != null && !DBNull.Value.Equals(obj))
{
string content = obj.ToString();
if (content.ToLower().Trim() == "YES")
{
suppliersDataGridView.Rows[e.RowIndex].Cells[7].Value = DateTime.Now.ToString("dd-MM-yyyy");
}
}
Reply
Answers (
5
)
How doing I do a payment page that take master card & paypal
export the data 1by1 like ID card format to xls from sql(C#)