Results 1 to 3 of 3

Thread: [RESOLVED] [2005] DataColumn Highlighting

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2007
    Posts
    362

    Resolved [RESOLVED] [2005] DataColumn Highlighting

    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?

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: [2005] DataColumn Highlighting

    You can get a numerical value for the current day of the week from:
    vb.net Code:
    1. CInt(Date.Now.DayOfWeek)
    You can then get the corresponding column by index from your DataGridView and set the appropriate property or properties of its DefaultCellStyle.

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2007
    Posts
    362

    Re: [2005] DataColumn Highlighting

    Thanks Sir.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width