Dynamically changing a cell's look in a datagrid
-
Hi There, I've created a little online calendar to help some of my coworkers keep track of shipping trucks. I have everything in place where it dynamically creates 3 tables each linked to last week, this week, and next week. I then create the datagrids and bind them to the tables. I used seperate tables just for the look because I wanted "this week" to appear larger and bolder in the middle of the other two weeks. Is there any way I can have the "this week" change the border color of the single cell depending on the current day of the week? How can you specify a certain cell in a datagrid control? Thank you!
"You're damned if you do, and you're damned if you dont" - Bart Simpson
-
Hi There, I've created a little online calendar to help some of my coworkers keep track of shipping trucks. I have everything in place where it dynamically creates 3 tables each linked to last week, this week, and next week. I then create the datagrids and bind them to the tables. I used seperate tables just for the look because I wanted "this week" to appear larger and bolder in the middle of the other two weeks. Is there any way I can have the "this week" change the border color of the single cell depending on the current day of the week? How can you specify a certain cell in a datagrid control? Thank you!
"You're damned if you do, and you're damned if you dont" - Bart Simpson
Actually, I think I may have just figured it out. Using my gridview, I can do something like this.
if (DateTime.Today.DayOfWeek.ToString() == "Tuesday")
{
gridview2.Rows[1].BorderColor = System.Drawing.Color.Blue;
}So, I just need to do a check to see what day it is and then convert that to a numeric 0 - 4 for the column specification.
"You're damned if you do, and you're damned if you dont" - Bart Simpson
-
Actually, I think I may have just figured it out. Using my gridview, I can do something like this.
if (DateTime.Today.DayOfWeek.ToString() == "Tuesday")
{
gridview2.Rows[1].BorderColor = System.Drawing.Color.Blue;
}So, I just need to do a check to see what day it is and then convert that to a numeric 0 - 4 for the column specification.
"You're damned if you do, and you're damned if you dont" - Bart Simpson
-
Actually, I think I may have just figured it out. Using my gridview, I can do something like this.
if (DateTime.Today.DayOfWeek.ToString() == "Tuesday")
{
gridview2.Rows[1].BorderColor = System.Drawing.Color.Blue;
}So, I just need to do a check to see what day it is and then convert that to a numeric 0 - 4 for the column specification.
"You're damned if you do, and you're damned if you dont" - Bart Simpson
Ah, I was close. I was able to get this to work by doing this:
gridview2.Rows[0].Cells[2].BorderColor = System.Drawing.Color.Blue;
"You're damned if you do, and you're damned if you dont" - Bart Simpson