How can i highlight the current day column by default (as per system Time) of my Databound DataGridView1 where Mon, Tue, Wed, Thu, Fri, Sat & Sun are the DataColumns?
Printable View
How can i highlight the current day column by default (as per system Time) of my Databound DataGridView1 where Mon, Tue, Wed, Thu, Fri, Sat & Sun are the DataColumns?
You can get a numerical value for the current day of the week from:You can then get the corresponding column by index from your DataGridView and set the appropriate property or properties of its DefaultCellStyle.vb.net Code:
CInt(Date.Now.DayOfWeek)
Just note that the DayOfWeek enumeration starts numerically at zero to represent Sunday. If your week starts at Monday then you'll have to do a little bit of simple translation.
Thanks Sir.