Results 1 to 5 of 5

Thread: [RESOLVED] Trying to change a DataGridView Cell attributes???

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    5,034

    Resolved [RESOLVED] Trying to change a DataGridView Cell attributes???

    I have a datagridview in which I am dynamically creating the rows and columns. I'm trying to set specific cells font to bold and not sure how to do it!
    Below is my code and what I'm trying to do.

    Code:
                   
                            row1 = New DataGridViewRow
                            cell = New DataGridViewTextBoxCell
                            cell.Value = "DRUG"
                            cell.Style.ForeColor = Color.DarkRed
                            cell.Style.Font.Bold = True
                            cell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
                            row1.Cells.Add(cell)
    The highlighted row is where I'm stuck. This particular doesn't work because the "Bold" property is ReadOnly.
    Blake

  2. #2
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,206

    Re: Trying to change a DataGridView Cell attributes???


  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    5,034

    Re: Trying to change a DataGridView Cell attributes???

    I couldn't get any of those examples to work.
    Blake

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    5,034

    Re: Trying to change a DataGridView Cell attributes???

    Nevermind wes...I got it! Was missing the "New"...
    Blake

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    Re: Trying to change a DataGridView Cell attributes???

    If this issue is resolved then please mark the thread as Resolved using the Thread Tools menu.

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