Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27033

VS 2010 [RESOLVED] Updating a DataGridView Cell Style

$
0
0
Hi,

I'm updating the cell style of a datagridview control but the colour change is affecting the complete row. Is there a way to only change the colour (and/or style) of just one specific cell?

The code I'm currently using is:

Code:

Private MySub
Dim Row as DataGridViewRow
For Each Row In MyDataGridView.Rows
Dim DGVStyle as DataGridViewCellStyle
DGVStyle = Row.DefaultCellStyle
DGVStyle.ForeColor = Color.Orange
Row.Cells.Item(2).Style = DGVStyle
Next Row
End Sub

As mentioned, the above changes the entire row to orange, not just the cell.

Any help would be appreciated.
Thanks,
N

Viewing all articles
Browse latest Browse all 27033

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>