How to Change Colour of Cell in datagrid More options More options

S

satish

I have a table with two columns field1 int,Field2 and added a column
to datagrid on runtime sum (field1+field2) ,upon changing the data in
either of the fileds the sum field or column too changes .
Intially there will be data in the fields ..and ii try to change the
value of column [field1] so the column [sum] also changes,Can i
change
the colour of the cells[Field1,sum] where the data has been
changed .I
have found out the cells where the data has been changed i here by
enclosing the code for finding out the data changed in cells

Private Sub btnHighlight_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnHighlight.Click
Dim row, col As Integer
For row = 0 To dsDb.Tables("Sum").Rows.Count - 1
For col = 0 To dsDb.Tables("Sum").Columns.Count - 1
If Not (dsDb.Tables("Sum").Rows(row).Item(col,
DataRowVersion.Original) = _
dsDb.Tables("Sum").Rows(row).Item(col,
DataRowVersion.Current)) Then
MsgBox("The Original value at cell[" &
row.ToString & "," & col.ToString & "] is " & _
dsDb.Tables("Sum").Rows(row).Item(col,
DataRowVersion.Original).ToString)
End If
Next
Next
End Sub


can any guide me how to change the colour of the cells where the data
has been changed
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top