We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

DropDownBarItem, DataSource, DataTable

Hi, i got a problem concerning the DropDownBarItem. I have it on a XPToolbar object. I''m binding the Datasource of it''s ListBox to a DataTable plus setting its Display -and ValueMember. Now i would like to select a specific item directly after I set the Datasource but if I check the count of the listbox items they return 0 until I click on the control at run-time. When is the DataSet populated to the Listbox ? Is there anything i can do to select a specific item in the ctor of my application ?? Please, need help

1 Reply

AD Administrator Syncfusion Team March 18, 2005 04:56 PM UTC

Hi Oliver, It appears that the ListBox doesn''t populate it''s Items collection until after it''s been displayed. You can workaround this by "flashing" the Popup momentarily. And by setting the ListBox to be invisible, you can prevent any additional flicker. The following code snippet demonstrates this: listBox1.Visible = false; this.dropDownBarItem1.PopupControlContainer.ShowPopup(new Point(0,0)); this.dropDownBarItem1.PopupControlContainer.HidePopup(); listBox1.Visible = true; Hope this helps. Regards, Gregory Austin Syncfusion Inc.

Live Chat Icon For mobile
Up arrow icon