473,485 Members | 1,473 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Two data grids comparing values

I have a datagrid that contains a list of decimal values. I want to compare
the values of one datatable to the other datatable and update my data grid.
For example my first datatable has the following data

Sample Number Location Reading1 Reading2 Reading3
Reading4.......ReadingX
12345 1 22.3 21.2
31.5 28.3 54.2
12345 2 21.4 23.2
33.8 31.9 49.9
.....

In my second table I have the following

Reading Min Max
1 20.3 24.1
2 20.8 21.1
3 30.1 32.2
4 14.1 16.8
....
X 49.1 55.2
What I would like to see in the data grid would be the readings and if the
reading is low, put the grid cell background in one color (yellow) and if it
is high, but the cell background in another color (red). The number of rows
in the first datatable will rarely be over 50 rows. The second table to
compare high low values will be around 20 rows. I have created a procedure
to go through every row, grab the value, look up the value in the second
table, and put the results in an array with the reading, followed by a 0,1,2
to indicate low, in range, high.

Results
Sample 12345 Results
22.3,1
21.2,2
31.5,1
28.3,2
54.2,1

I then want to parse the array and populate a table with the results. Would
it be easier to put the first table into a Datagrid, then move through each
cell and compare values? Any help would be great.

John
Aug 2 '07 #1
0 1284

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

Similar topics

2
1492
by: orekinbck | last post by:
Hi There Using C# forms, I have a main screen that contains 2 data grids. * The data grids are connected to ArrayLists (each grid has its own ArrayList) * The data grids are intended for...
6
1469
by: Paul | last post by:
Hi I have 2 data grids and several controls on a web page. The grids will vary in size, just wondering if the lower grid could be covered by part of the upper grid depending on its size or is there...
1
1282
by: Piotr Karwatka | last post by:
Hi! I need to do relation beetwen one table (task 2 task) and i do something like that" DataSet data = new DataSet(); myCommand.Fill(data);
19
2616
by: Dennis | last post by:
I have a public variable in a class of type color declared as follows: public mycolor as color = color.Empty I want to check to see if the user has specified a color like; if mycolor =...
7
1294
by: Tull Clancey | last post by:
Hi all. I'm fast becoming very fed up with the standard .net datagrid. I rely on grids a great deal, the .net grid is a pain to work with and very difficult to customise. Has anyone used any...
6
1876
by: abbylee26 | last post by:
Im comparing values in a field while doing a loop if sAct<>myData(5,i) then At the end of the loop I make the value of sAct equal the current myData This will work when comparing other fields...
36
3165
by: Chuck Faranda | last post by:
I'm trying to debug my first C program (firmware for PIC MCU). The problem is getting serial data back from my device. My get commands have to be sent twice for the PIC to respond properly with...
4
1660
by: GFM GToeroe | last post by:
Hi! Actually I have to solve the following problems: Given is a dynamic set S of (moving, vanishing and arising) points (2D). It could be the case that |S|>100 or even >1000 but not >20000....
9
3990
by: Anil Gupte | last post by:
After reading a tutorial and fiddling, I finally got this to work. I can now put two tables created with a DataTable class into a DataRelation. Phew! And it works! Dim tblSliceInfo As New...
0
7090
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
6960
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7116
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
7161
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7275
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...
0
5418
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3058
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3063
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1376
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.