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

Home Posts Topics Members FAQ

datagridview problem?

1 New Member
i have problem in datagride view.i want to match all the rows of datagrid view rows one by one with specific value my code is given below it is not working ...
Expand|Select|Wrap|Line Numbers
  1. for(int i = 0; i < dataGridVie.RowCount;i++ ){
  2.                 if(    dataGridVie.Rows[i].Cells[0].Value.ToString().Trim() == "F7" && dataGridVie.Rows[i].Cells[1].Value.ToString() == "slow wave" )
  3.                     count++;}
  4.             for(int i = 0; i < dataGridVie.RowCount;i++ ){
  5.                 if(dataGridVie.Rows[i].Cells[0].Value.ToString().Trim() == "F3" && dataGridVie.Rows[i].Cells[1].Value.ToString() == "slow wave" )
  6.                     count++;
  7.  
  8.         }
  9.             for(int i = 0; i < dataGridVie.RowCount;i++ )
  10.             {
  11.  
  12.         if(  dataGridVie.Rows[i].Cells[0].Value.ToString().Trim() == "T3" && dataGridVie.Rows[i].Cells[1].Value.ToString() == "slow wave" )
  13.             count++;
  14.             }
  15.             for(int i = 0; i < dataGridVie.RowCount;i++ )
  16.             {
  17.                if(     dataGridVie.Rows[i].Cells[0].Value.ToString().Trim() == "C3" && dataGridVie.Rows[i].Cells[1].Value.ToString() == "slow wave")
  18.                    count++;}
  19.             for(int i = 0; i < dataGridVie.RowCount;i++ ){
  20.                  if(   dataGridVie.Rows[i].Cells[0].Value.ToString().Trim() == "T5" && dataGridVie.Rows[i].Cells[1].Value.ToString() == "slow wave" )
  21.                      count++;}*/
  22.          /*   for(int i = 0; i < dataGridVies.RowCount;i++ )
  23.             {
  24.  
  25.                   if(  dataGridVies.Rows[i].Cells[0].Value.ToString().Trim() == "O2" && dataGridVies.Rows[i].Cells[1].Value.ToString() == "slow wave" )
  26.                       count++;}
  27.           /*  for(int i = 0; i < dataGridVie.RowCount;i++ )
  28.             {if(      dataGridVie.Rows[i].Cells[0].Value.ToString().Trim() == "P2" && dataGridVie.Rows[i].Cells[1].Value.ToString() == "slow wave")
  29.                 count++;}*/
  30.             if(count==4)
  31.  
  32.                 {
  33.                     MessageBox.Show("");
  34.                 }
Aug 24 '14 #1
0 986

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Irfan | last post by:
hi, I have a 'TimeSheet' Table in the database that holds data about the time spent by an employee on each project on a particular day. TS_pk Emp_fk Project_fk hrsWorked ...
0
by: Pieter Coucke | last post by:
Hi, I have a DataGridView, that contains a list of Articles, which can be added (automaticly via the AllowUserToAddRows) and changed by the user. The current item is also displayed in textboxes...
1
by: sapkal.manish | last post by:
Question : How can I find actual row position of DataTable in DataGridView when DataTable is sorted / My source code like this Private WithEvent dgvInwDet as new DataGridView Private...
0
by: Dave | last post by:
I have a datagridview I call the CellValidating event and if the the cell does not validate I want to reset the cell to a default value. My code actually executes this statement: ...
1
by: Martin | last post by:
Hi, I'm having a problem with a datagridview control when trying to read the value of an unbound checkbox cell. The code below works fine if I click on any text cell, bound or unbound, and...
0
by: Paul | last post by:
I want to create a class that inherits from the DataGridView. I want to initialize the class with three columns. Below is the code. Then my problem is stated afterwards. Public Class...
0
by: Tim Wallace | last post by:
I have a DataGridView object in a C# desktop app (.NET 2.0, by the way). I am setting the DGV to use a SelectionMode of "ColumnHeaderSelect". I am dynamically creating all of the columns and when...
6
by: =?ISO-8859-1?Q?Andrea_M=FCller?= | last post by:
Hello, I have one problem. Include my project is a dataset with tables. During my process I create a new temporary table. The dataset use my DataGrid Control. The use delete now one, two...
1
by: fatimang | last post by:
aloha!!!!!........ how to manipulate the record pointer of the table inside the datagridview. plz show the codes related to this problem.... thank u.....
2
by: swapnil350 | last post by:
I have developed an application in vb.net (Win32 Appl) I have problem in datagridview i have uploaded image which where i made a red colored circle image :- ...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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...
1
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.