amaimedia
asked on
Datagrid view another colors
VB.net
Hi experts
How can I mark negative values in columns of datagrid view with other colors? The Columns are type of integer....
Hi experts
How can I mark negative values in columns of datagrid view with other colors? The Columns are type of integer....
Why do we always have to make assumptions about data grid type? That is code for a WinForms DataGridView, but there is the 1.1 ASP.NET DataGrid, ASP.NET 2.0 GridView, and the plain ol' WinForms DataGrid for both 1.1 and 2.0.
Bob
Bob
Check this link to see if this is want you are looking for...
https://www.experts-exchange.com/questions/22477105/Datagridview-multi-color-cell-text.html
ASKER
This solutions doesn't work in my case....
I fill this datagrid view from datatable
I fill this datagrid view from datatable
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
dgv.Rows(e.RowIndex).Cells
example
Private Sub dgv_CellValidating(ByVal sender As Object, ByVal e As System.Windows.Forms.DataG
' Don't try to validate the 'new row' until finished
' editing since there
' is not any point in validating its initial value.
If dgv.Rows(e.RowIndex).IsNew
'add validation that value in the cell is numeric
If IsNumeric(e.FormattedValue
'check condition
If e.FormattedValue < 0 Then
dgv.Rows(e.RowIndex).Cells
End If
End If