Here is the scenario where i have to search for an element in the combobox.
an element - value being a string.
I am using HtmlSelect control for combobox.
but htmlSelectControl.Option.Contains( "is accepting an HtmlOption ")
how do i convert a string to a HtmlOption object??
1 Answer, 1 is accepted
0
Stoich
Telerik team
answered on 05 Jan 2011, 01:52 PM
Hello Kiran,
you can't convert a String to an HtmlOption object. You need to pass an HtmlOption object to the method htmlSelectControl.Option.Contains(). When you pass the object the method checks whether this object is found in the Collection of the HtmlSelect element.
You can't use the method since you can't get your hand on an HtmlOption object. You can create one yourself but htmlSelectControl.Option.Contains() will return False for that object because it won't be among the collection of the HtmlSelect.
Instead let me suggest a different approach to achieve what you want: