如何将所有项目/数据/值从列表框导出/传输到datagridview [英] how to all items/data/value export/transfer from listbox to datagridview

查看:90
本文介绍了如何将所有项目/数据/值从列表框导出/传输到datagridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在列表框的listbox中列表框中的列表框总共有56个组合(数据/数字),

所以我想发送/传输/上传到datagridview到7行,8列(datagridview)

和我在Visual Basic 2010中工作



1. Button1(浏览)

2. Listbox1(56列表框中的组合)

3. NumericUpDown1(7行)

4. NumericUpDown2(8列)

5. DatagridView

6. Button2(创建表格)

7. Button3(上传)..........?

8. Button4(清除)



56组合



1. A,B,C

2 。A,B,D

3. A,B,E

4. A,B,F

5. A,B, G $ / $
6. A,B,H

7. A,C,D







56. F,G,H



这些组合它h如在列表框中,如何传输/发送到datagridview(8列和7行),这些数据如何从列表框传输到datagridview.plz帮助我。



* *记住**总是Listbaox值/数据将等于datagridview或datagridview的总单元格,如果56组合或更多则它将相等

(列表框数据= NumericUpDown1 * NumericUpDown2)

(56组合= 7行* 8列)

或列表框项目= datagridview /总单元格/(n)行*(n)列

i have total 56 combination(data/numbers) in listbox in listbox in listboxt in listbox,
so i want to sent/transfer/upload to datagridview into 7 row, 8 Columns ( datagridview )
and i m working in visual Basic 2010

1. Button1 (Browse)
2. Listbox1 (56 Combination in the listbox)
3. NumericUpDown1 (7 Row )
4. NumericUpDown2 (8 Columns )
5. DatagridView
6. Button2 (Create Table)
7. Button3 (Upload)..........?
8. Button4 (Clear)

56 Combination

1. A,B,C
2. A,B,D
3. A,B,E
4. A,B,F
5. A,B,G
6. A,B,H
7. A,C,D
" "
" "
" "
56. F,G,H

these Combination it has in listbox, so how to transfer/sent to datagridview (8 Columns and 7 Row), how these data transfer from listbox to datagridview.plz help me.

**Remember** Always Listbaox value/data will be equal of the datagrideview or total cell of datagridview, if 56 combination or more then it will be equal
( Listbox data = NumericUpDown1*NumericUpDown2 )
( 56 Combination = 7 Rows*8 Column )
or Listbox items = datagridview/total cell/(n)Rows*(n)Column

推荐答案



in vb.net solution
Dim Counter As Integer = 0

     For I As Integer = 0 To 6
         Dim RowItems(7) As String
         For J As Integer = 0 To 7
             RowItems(J) = ListBox1.Items(Counter)
             Counter += 1
         Next
         DataGridView1.Rows.Add(RowItems)
     Next


这篇关于如何将所有项目/数据/值从列表框导出/传输到datagridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆