How can I default Dropdown selection to first item in list?

I am populating the data of the dropdown using a SQL Query (which returns only one column) and I want to default the Dropdown selection to first item in the returned recordset. I also want to have the selection label be set to this value. How can I do this?

By default the dropdown defaults to and I have to select the first item.

I imagine this is easy, but for some reason I have been struggling with many different options tried.

Thanks,
Bob

Try saving the window with the ‘selected value’ property set to ‘0’ instead of ‘-1’. Also, make sure you have your SQL query binding set to not poll.

I tried your suggestion but the behavior did not change.

I found that adding the following line to the propertyChange event of the Dropdown did the trick:

      event.source.parent.getComponent('Dropdown 1').selectedValue = 0

I’m glad you found a solution! Just out of curiosity, what version of Ignition are you using?

7.5.1