Home All Groups Group Topic Archive Search About
Author
7 Apr 2006 4:36 AM
diego
Hi all,

If I have a combo bound to as datasource, how can I search for a
particular value. example i have the value 1,2,3,4 in col1 and A, B, C,
D in col 2 of a datatablem and this datatable is bound to a combo box.
how can i search for the value C so that if found the combobox
automatically sets C as the selected item.

I hope I got my point across.

Thanks in advance.

Diego

Author
7 Apr 2006 6:54 AM
Cor Ligthert [MVP]
Diego,

Use as datasource a dataview
Than find in that dataview the position and set the index accoording to
that.
(if you use a currencymanager the position from that)

http://msdn2.microsoft.com/en-us/library/system.data.dataview.find(VS.80).aspx

The text on this page is wrong, it has to be find an index.
The datarowcollection find finds a row.

I hope this helps,

Cor

Show quoteHide quote
"diego" <diego***@yahoo.com> schreef in bericht
news:1144384591.942089.213870@v46g2000cwv.googlegroups.com...
> Hi all,
>
> If I have a combo bound to as datasource, how can I search for a
> particular value. example i have the value 1,2,3,4 in col1 and A, B, C,
> D in col 2 of a datatablem and this datatable is bound to a combo box.
> how can i search for the value C so that if found the combobox
> automatically sets C as the selected item.
>
> I hope I got my point across.
>
> Thanks in advance.
>
> Diego
>