473,394 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to Change Colour of Cell in datagrid

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

Mar 27 '07 #1
0 1319

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Lois | last post by:
My website formatting knowledge is mostly HTML; I know hardly any Javascript. Recently I created a site with a nav bar in table format across the top of the page, and I made the background colour...
1
by: JD | last post by:
How do i get rid of the 1st column that appears in a datagrid? I do not want this? Also how do i change the colour of the background of a cell when the user selects it. i.e for the first coloumn...
1
by: ms | last post by:
Hi, I've been trying to find a way to change a cell's colour when clicking it. What I've found so far is to change the background colour by using: function whenClick(navElm) { var state1 =...
3
by: Peter Williams | last post by:
Hi All, I want to write some javascript for a html page which does the following. Imagine that the page contains a table with 2 columns and 3 rows, e.g.: +---+---+ | A | B | +---+---+
1
by: QT | last post by:
Dear Sirs, I have a datagrid which is taking sorce from .mdb file. I want to change some cell's font colour to red depent of data conditions. Can I do that? Best Regards
5
by: Earl | last post by:
I want to fire a database update off of a single change to a single cell in the datagrid. This apparently cannot be done using keypress, keyup, keydown, etc. I've read George Shepard's FAQ and...
0
by: Badino | last post by:
Hi, Can someone tell me what to put in this code so that if a user selects 0 (Black) then make the font white (0) as my default colour is black on my Excel spreadsheet. Private Type...
1
by: satish | last post by:
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 ....
0
by: joinzulfi | last post by:
Dear fellows! I have designed a form having SaleMasterTable and SaleDetailTable. SaleDetailTable is Bounded with DataGrid. Now I want that if in2nd Column's cell (it is combobox) value is...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.