jpvniekerk Active Member Licensed User Longtime User May 30, 2012 #1 I've been struggling with this for the best part of a day and have read stacks of posts on the forum... But I'm still stuck... So please Help! I'm creating spinners from database tables, and have to "point" the spinner to the current item. I know how to do it with the spinner.selectedindex command, but I'm not able to get the right index position from the database table. Test Program is attached. Advice will be GREATLY appreciated!! Attachments TestProg.zip 12.2 KB · Views: 238
I've been struggling with this for the best part of a day and have read stacks of posts on the forum... But I'm still stuck... So please Help! I'm creating spinners from database tables, and have to "point" the spinner to the current item. I know how to do it with the spinner.selectedindex command, but I'm not able to get the right index position from the database table. Test Program is attached. Advice will be GREATLY appreciated!!
klaus Expert Licensed User Longtime User May 30, 2012 #2 Unfortunately SelectedItem is read only. You need to find the indexes on your own in For/Next loops. The attached program does it. Best regards. Attachments TestProg1.zip 12.3 KB · Views: 493 Upvote 0
Unfortunately SelectedItem is read only. You need to find the indexes on your own in For/Next loops. The attached program does it. Best regards.
jpvniekerk Active Member Licensed User Longtime User May 30, 2012 #3 Klaus - You're a STAR!!!! Works like a charm! Thanks Upvote 0
G gregmartin64 Member Licensed User Longtime User Mar 7, 2013 #4 As an extra tip, you can just do this in one line, if you have your data loaded in a map or any list that exposes IndexOf For example with my field called "type" Spinner.SelectedIndex=Spinner.IndexOf(m.Get("type")) Will do the same thing as looping through the dataset or list and saves a lot of code if you have a few spinners on your view. Upvote 0
As an extra tip, you can just do this in one line, if you have your data loaded in a map or any list that exposes IndexOf For example with my field called "type" Spinner.SelectedIndex=Spinner.IndexOf(m.Get("type")) Will do the same thing as looping through the dataset or list and saves a lot of code if you have a few spinners on your view.