Absent Member.
Absent Member.
1119 views

Further question about individual cell properties in a datagridview??

Jump to solution

Is it possible to set the background colour of any given cell to one other than the default.

This is in respect to being able to set the cells to READONLY or not ok.

In the event the cell is READONLY I'd also like to set the background colour of the cell to a meaningful colour to indicate to the user that the cell IS a READONLY cell and that the data inside that cell cannot be edited.

Thanks. 

0 Likes
1 Solution

Accepted Solutions
Micro Focus Expert
Micro Focus Expert

Yes, you can set the background color of the individual cells in the same place where you set the ReadOnly property.

Example:

    set dataGridView1::Rows[sub-1]::Cells["Amount"]::ReadOnly to true
    set dataGridView1::Rows[sub-1]::Cells["Amount"]::Style::BackColor to type Color::Red

View solution in original post

0 Likes
1 Reply
Micro Focus Expert
Micro Focus Expert

Yes, you can set the background color of the individual cells in the same place where you set the ReadOnly property.

Example:

    set dataGridView1::Rows[sub-1]::Cells["Amount"]::ReadOnly to true
    set dataGridView1::Rows[sub-1]::Cells["Amount"]::Style::BackColor to type Color::Red

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.