Click here to Skip to main content
15,891,473 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

My application is in VS2008 and coded in VB.net.

I have a datagridView(DGV) on one of my form.DGV contains a column of type DatagridViewComboboxColumn.I have another column of SrNo.

Consider Table1 to be the table from where my DatagridView is filled which contains following fields SrNo,Value1,Value2.

My requirement is i want to fill the values in my DatagridViewComboboxColumn from Table1.The DatagridViewComboboxColumn's combobox should contain values of columns Value1,Value2 of Table1.

Sample data of Table1

SrNo Value1 Value2

1 2 3

2 4 5

As data in datagridView is filled from Table1 the data of SrNo column of Table1 is also populated in one of the column of DGV.

Now my DatagridViewComboboxColumn combobox should contain the values of Value1 and Value2 of Respective SrNo.

Like Row one of my DGV has SrNo 1 as first value,so the Value1 and Value2 of SrNo 1 should be added to the row's DatagridViewComboboxColumn.

Select distinct Value1,Value2 From Table1 where SrNo=DGV.items(0,DGV.currentcell.rowIndex).value.Hope this Query willl make things more clear

Please Suggest.
Posted

1 solution

Have a look here[^]. It may help.
 
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