borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2011 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Next Topic (How to give a windows form a web look) New Topic New Poll Post Reply
AndreaVB Forum : VB.Net : How to add Items in the DatagridViewComboboxColumn of DatagridView during runtime
Poster Message
Ehtesham Siddiqui
Level: Trainee

Registered: 22-09-2011
Posts: 2

icon How to add Items in the DatagridViewComboboxColumn of DatagridView during runtime

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.

11-10-2011 at 03:50 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB.Net : How to add Items in the DatagridViewComboboxColumn of DatagridView during runtime
Next Topic (How to give a windows form a web look) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2011 Andrea Tincaniborder