Where to update datagrid cells
-
Hello, So I have some code to change the color of a cell on a datagridview.
If e.Value.ToString.Length > 0 Then e.CellStyle.BackColor = Color.Blue e.CellStyle.ForeColor = Color.White End If
Where is the best place to put this, cell formatting or cell painting. Or is there a better place? Thanks! Rudy -
Hello, So I have some code to change the color of a cell on a datagridview.
If e.Value.ToString.Length > 0 Then e.CellStyle.BackColor = Color.Blue e.CellStyle.ForeColor = Color.White End If
Where is the best place to put this, cell formatting or cell painting. Or is there a better place? Thanks! RudyCellFormatting event is better to handle this type of customized formatting. Have a look at this... http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.cellformatting.aspx[^]
The man who makes no mistakes does not usually make anything. ~Edward Phelps Man's wisest mistake: Marriage. ~ Suresh Suthar
-
CellFormatting event is better to handle this type of customized formatting. Have a look at this... http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.cellformatting.aspx[^]
The man who makes no mistakes does not usually make anything. ~Edward Phelps Man's wisest mistake: Marriage. ~ Suresh Suthar