473,799 Members | 2,786 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Looping in Datagridview

6 New Member
Mine is a windows app. containing forms named BOM nd BOMSelected..

There is datagridview in BOM which contains checkbox column.. When the user selects checkbox, the selected rows should be seen in the datagridview of other form, SelectedBom..

I have coded but don't get it working.. Some error..

Can you please help ??

Your Help is greatly appreciated..

Here is what i have done !!

Expand|Select|Wrap|Line Numbers
  1.  
  2. Public Class SelectedBom
  3.  
  4.     Private Sub SelectedBom_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  5.         'TODO: This line of code loads data into the 'HemDatabase1DataSet4.partno' table. You can move, or remove it, as needed.
  6.         'Me.PartnoTableAdapter.Fill(Me.HemDatabase1DataSet4.partno)
  7.  
  8.         Dim count As Integer = 0
  9.  
  10.         For j As Integer = 0 To BOM.dgv1.RowCount - 1
  11.  
  12.             If BOM.dgv1.Rows(j).Cells(0).Value = True Then
  13.  
  14.                 Dim ro As New DataGridViewRow
  15.                 DataGridView2.Rows.Add(ro)
  16.  
  17.                 For i As Integer = 0 To BOM.dgv1.ColumnCount - 1
  18.                     Me.DataGridView2.Rows(count).Cells(i).Value = BOM.dgv1.Rows(j).Cells(i).Value
  19.                 Next
  20.  
  21.                 count += 1
  22.  
  23.             End If
  24.  
  25.         Next
  26.  
  27.     End Sub
  28. End Class
  29.  
  30.  
The attachment shows the output I have obtained !! Please help..
Attached Images
File Type: jpg Ss3.jpg (31.0 KB, 98 views)
Oct 15 '11 #1
0 1207

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

Similar topics

5
3374
by: Stimp | last post by:
This is a question I'm carrying over from a previous one I made today since I've simplified where the problem is... I have a datatable, tblFeatures, which has around 30 columns (one for each 'feature'). I also have between 1 and 3 rows of data (one for each 'vehicle'). I want to transpose this table so that I ouput the rows horizontally and the columns vertically.
7
12631
by: Mitchell S. Honnert | last post by:
Is there an equivalent of the DataGrid's DataGridTableStyle for the DataGridView? If not, is there an easy way to duplicate the DataGridTableStyle's functionality for the DataGridView? Here's the background for my question... Before I switched my application over to the Fx 2.0, I used a DataGrid to display my data. I would store different DataGridTableStyles (each one with a custom set of columns) in the DataGrid.TableStyles property...
4
6107
by: lord.zoltar | last post by:
I am wondering how you guys highlight cells or rows (by changing the text or background colour) in a DataGridView. Right now, I apply styles to certain rows or cells in the CellFormatting even handler, but the way it works is by looping through all of the rows and then deciding if that rows needs special formatting. The problem is that I don't think this method will scale well. I have a dataset with 5,000 rows (and others are larger, this...
2
8738
by: Rick Shaw | last post by:
Hi, I have a problem with the datagridview not refreshed when the application first appear on the screen. The datagridview display data from a table in the dataset. At the same time, I've added checkbox columns that are not bounded the table. This datagridview is located in the tab (2nd). I thought I mention that since that might be part of the problem (?). When the applications start, it will need some parameter criteria selection...
2
2657
by: Scotty | last post by:
Hi, Hope someone can help me I have a datagridview I want to print Code below works fine if I print the data if there is only 1 page (without using hasmore pages '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! If intRowPos <= 10 Then e.HasMorePages = False
0
2507
by: jeastman - Hotmail | last post by:
Hello world Excuse, not to be written English and it helps me with a translator. I am new programming in C#. I made a control inheriting the DataGridView to be able to add controls done by my.
2
1736
by: Beagley | last post by:
I'm trying to give my user the ability to print multiple personell badges with one swoop. I can select multiple rows from my DataGridView object, but am having trouble looping through those rows to print my data. Here is the code that I currently have that does not work... For Each group As DataGridViewSelectedRowCollection In Me.dgridContractors.SelectedRows For Each row As DataGridViewRow In group I'm fairly new to VB...
5
6692
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
I want to be able to increase or decrease row heights of a populated DataGridView from the keyboard. I set up a test program with menu items to increase and decrease, assigned shortkey keys (ctrl-UpArrow and ctrl-DnArrow), and attached handlers that execute this code: public partial class MainForm : Form { . . . dataGridView.RowTemplate.Height += increment; Refresh();
3
5749
by: Andrus | last post by:
I have DataGridView in virtual mode containing 3500 rows. In code below, assigning to RowCount value to 3500 takes 8 seconds. CPU usage goes high at this time. Stepping by F11 into user code shows few celltemplate property getters and combobox/datecombo constructor calls without database access which does not take a lot of time. Debug output (below) shows lot of messages Stepping over non-user code. Running in release mode from...
0
1313
by: cday119 | last post by:
Hi All, I have a datagridview, and I'm looping threw the selected rows like so: For Each row As System.Windows.Forms.DataGridViewRow In OrderDataGridView.SelectedRows This DataGridView Holds Order Information and it contains a column called ShippingID, which is used as a foreign key relation to another table(ShippingAddress) in the DataSet. My question is how to I access the related ShippingAddress data? Basically I want to do...
0
10488
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10029
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7567
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6808
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5467
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5588
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4144
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 we have to send another system
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.