468,107 Members | 1,451 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,107 developers. It's quick & easy.

How can i get values from datagrid



Hi,

How can i get values from datagrid to combobox and should select the same
name as in datagrid row on the combobox control
In my vb.net windows application ,i have combobox which is populated by
sqlserver database table.When i select value from combobox ,value saved in to
other table of my database
and i use to datagrid to show this table.

Myproblem is ,
i want to get text value from datagrid and my combobox should select this
value (Which i selected before) when i want to update values in datagrid
e.g
combobox
-----------
John
George
Tom <- i select tom and saved to my datagrid table.

Table of DataGrid
---------------------
Name Age Country
Tom 29 USA

i want to update Tom and i m selecting this row

Combobox
------------
Tom <-----should selected automatically
i want to do something like that but i couldn't:
(cytpe(combobox1.selectedItem,DataRowView).item(1) )=DataGrid1.item(datagrid1.currentRowIndex,1)))
by the way there is no combobox on datagrid but i use independent combobox
on my form which is populated by another table on my database .

i select name field from combobox
enter age and country from textboxes and then i save these values to other
table on my database.

and i used this code for combobox to save value to the related part of
datagrid

ctype(comboboxName.selecteditem,datarowview).item( 1).tostring
and there is no problem with this...

The problem is getting values from datagrid and select this value in
combobox...

Thanks again...

Thanx.

Jul 21 '05 #1
0 1677

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Derek | last post: by
4 posts views Thread by Job Lot | last post: by
3 posts views Thread by Kevin Pedersen | last post: by
4 posts views Thread by Vik | last post: by
reply views Thread by Gamze | last post: by
1 post views Thread by Solo | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.