Reputation: 765
I have made a DropDownListBox inside a Datawindow.
Upon Item Change, I set and save the Value of the selected item in that DropDown in an INI File.
In my Open Event, I use setitem to Set the saved value in that dropdown. The problem here is that it doesnt setfocus on that index of the selected item in those dropdown.
I also used, SetRow(), setcolumn(), SetText() just to make the Focusing of the Selected Text. The problem on this one is I have like 100+ Items. When the chosen value is in the middle, let's say Index#50, the ScrollBar focus is still on the top Index#1, not at Index#50.
Any help? Thanks.
Upvotes: 1
Views: 5949
Reputation: 620
A) This is so much easier with a DDDW editstyle right in the datawindow. You just do a SetItem( row, column, value) to set the initial value in the dropdown.
B) That having been said, I would not call 100+ items in a listbox "effective UI design". I would evolve that into an editbox, with search-on-type capabilities, like you see in the Google search page.
Upvotes: 0
Reputation: 10845
1) Try to play with SetRedraw
dw.SetRedraw(false)
dw.SetItem(...)
dw.SetRedraw(true)
2) Try to use DDDW instead of DDLW. And use DDDW with integer index column. Sometimes builder fails with string "keys"
Upvotes: 2