How to programmatically set a value in a dropdown list based on a barcode scan?

1 Answer 23 Views
DropDownList
Michael
Top achievements
Rank 1
Iron
Michael asked on 06 Mar 2025, 04:26 AM

I have an App that uses a barcode scanner and interacts with a website using a webview control.  The scanner does not use a keyboard wedge to return data - it uses a callback function to pass the scanned barcode data into the website (built using React and Telerik controls).

In order to provide a target for the barcode data, the user must click the editable control (to place the focus on the control) so that the scanned barcode text is then placed in that control.  For a text box, this is a trivial matter, but for a dropdown list this seems to be more complex.  When a user selects the dropdown list, the list opens up complete with the search box.  Is there a programmatic way of populating that search box with the text obtained from the barcode scan?  I have even tried directly manipulating the DOM to try to set the inner text property, but without success.

Thanks in advance

Mike

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 07 Mar 2025, 12:31 PM

Hello,

You can set the filter of the DropDownList by using the filter prop. If you want it to be more interactive you can also programatically open the DropDownList and filter its values. Here is an example how this could be setup - https://stackblitz.com/edit/react-pcpzrrei-aeashr5e?file=app%2Fapp.tsx

Please review it and let me know if you have further questions.

Regards,
Plamen
Progress Telerik

Enjoyed our products? Share your experience on G2 and receive a $25 Amazon gift card for a limited time!

Tags
DropDownList
Asked by
Michael
Top achievements
Rank 1
Iron
Answers by
Plamen
Telerik team
Share this question
or