Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
i have total 56 combination(data/numbers) in listbox in listbox in listboxt in listbox, so i want to sent/transfer to datagridview into 7 row, 8 Columnn ( datagridview ) and i m working in visual Basic 2010

all data transfer from listbox to datagridview

1,2,3
1,2,4
1,2,5
1,2,6
1,2,7
1,2,8
1,3,4
1,3,5
1,3,6
1,3,7
1,3,8
1,4,5
1,4,6
1,4,7
1,4,8
1,5,6
1,5,7
1,5,8
1,6,7
1,6,8
1,7,8
2,3,4
2,3,5
2,3,6
2,3,7
2,3,8
2,4,5
2,4,6
2,4,7
2,4,8
2,5,6
2,5,7
2,5,8
2,6,7
2,6,8
2,7,8
3,4,5
3,4,6
3,4,7
3,4,8
3,5,6
3,5,7
3,5,8
3,6,7
3,6,8
3,7,8
4,5,6
4,5,7
4,5,8
4,6,7
4,6,8
4,7,8
5,6,7
5,6,8
5,7,8
6,7,8

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....
Posted
Updated 29-Oct-14 6:03am
v2
Comments
Sergey Alexandrovich Kryukov 27-Oct-14 8:53am    
Why and what's the problem?
What have you tried so far?
—SA

1 solution

Get all the items of the listbox :

C#
foreach (DataRowView drv in listBox1.Items)
        {
            int id= int.Parse(drv.Row[listBox1.ValueMember].ToString());
           
        }


Depending on how you bind your DataGridView and if you actually need to update existing rows or add new rows, you need to use the values from the listbox to do so.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900