Results 1 to 2 of 2

Thread: Datagridview selected cell forecolor not to be changed

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2014
    Posts
    287

    Datagridview selected cell forecolor not to be changed

    Hi,

    I would like to avoid the selected cell forecolor of DatagridView when it is selected. How it is possible?

    Code:
            Me.dgvTable.Columns(19).DefaultCellStyle.ForeColor = Color.Red
            Me.dgvTable.Columns(21).DefaultCellStyle.ForeColor = Color.Blue
    Thanks in advance for any support.
    Attached Images Attached Images  

  2. #2
    PowerPoster boops boops's Avatar
    Join Date
    Nov 2008
    Location
    Holland/France
    Posts
    3,163

    Re: Datagridview selected cell forecolor not to be changed

    Here's how you can change a cell's SelectionForeColor:
    Code:
    dgvTable.Rows(row number).Cells(column number).Style.SelectionForeColor = color
    Is that sufficient information?

    BB

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