views:

172

answers:

2

when DataGridView has a combobox column, how can I get the text it displays as oppose to the value it represents? When I do DGV.Item("cbo",i).Value I get the value but it won't take DGV.Item("cbo",i).Text. I trying Ctype(DGV.Item("cbo",i),ComboBox).Text and this does not work either.

A: 

Umm are you talking about Win Forms? If so, Value is the property you want, and is what is to be displayed on the screen and held behind the scenes. If you want something different not shown to the user, I've often used the property Tag for that.

GONeale
Yes, winform. Value gives the value/ID not what is displayed
bochur1
A: 

Try

DGV.item("cbo",i).DisplayMember

Ando