Avatar of mkumaraguru49
mkumaraguru49
 asked on

VB.Net Gridview Combobox column

Hi
I am using GridView control with 4 textbox and 1 combobox cell type.  In the combobox, I've added some items in the design time. Let's say,  3 products like keyboard,mouse,printer.

Now, I want to load data into the gird from database using bound method.  In this case, If my database values is "mouse", then the 2nd item of the combobox sould be selected when boound data.

How can i achieve it.  Pls help me to provide some sample code.

Thanks


Visual Basic.NET

Avatar of undefined
Last Comment
amar31282

8/22/2022 - Mon
amar31282

suppose your combobox is CMB1.  This is how you can make the default selected item in a ComboBox

CMB1.SelectedIndex = CMB1.FindStringExact(String);
mkumaraguru49

ASKER
Thanks for the reply, If I use unbound method, it would be a workable solution.  But I want to bound some datasource with gridview control.  In such case, How to achieve it.

Please give me some sample.  Thank you

ASKER CERTIFIED SOLUTION
amar31282

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
mkumaraguru49

ASKER
Thanks a lot amar31282
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
amar31282

for further reference of any other user i am attaching files here with changed extension because my file will be deleted automatically from the above link

For database
Create an Access database Named ReturnBill.mdb.
In access database filie create one table named table1 with two column with data as below
ID      txt
1      Text1
2      Text2
3      Text3
4      Text4
5      Text1
6      Text3

WindowsApplication2.zip
amar31282

you need to keep this database in bin/debug directory of application