开发者

first value should be selected when loading the data in ComboBox

开发者 https://www.devze.com 2023-01-13 15:54 出处:网络
I had开发者_如何学Python a comboBox and loading the datadynamically from the server. i need to display the first value in comboBox as a selected value and based on the value data should be populated o

I had开发者_如何学Python a comboBox and loading the datadynamically from the server. i need to display the first value in comboBox as a selected value and based on the value data should be populated on the grid. Please send me a sample example on the same if nay one knows.

thanks, Ravi


You can select the first value by setting: selectedIndex=0 or set the selectedItemproperty.

But you should make sure that there is an item which you can select. This could be for example done in the setter of the dataProvider.


Another way to make sure that you have data is add a ChangeWatcher to the dataProvider, so that you will be notified when new data is bound. Then you can simply traverse the data and select whichever one you want, in your case selectedIndex=0;

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号