Combobox not populating when on a SF User Control


Author
Message
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
You'll need to cast the control to a combo - DirectCast(uControl.Controls("cboClients").Requery(),ComboBox).Requery()



You'd need to replace the "ComboBox" with the actual type, something like Microfour.StrataFrame.UI.Windows.Forms.Combobox.



Alternately, you could provide a property on the user control that exposes the combobox or a method that does the requery.



Jeff Pagley
Jeff Pagley
Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)
Group: StrataFrame Users
Posts: 223, Visits: 893
Hi Ben,

This what I tried but the compiler doesn't like it.

uControl.Controls("cboClients").requery()

The compiler message is as follows:

'requery' is not a member of 'System.Windows.Forms.Control'.


StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Aha, in that case, the ComboBox will not populate on its own.  You'll have to call Requery() on it.  So, add uControl.cbCombo.Requery() before the code that you posted and it should get you fixed.
Jeff Pagley
Jeff Pagley
Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)
Group: StrataFrame Users
Posts: 223, Visits: 893
I not sure how to do what you are suggesting.  The parent form is already loaded.  Then through a control's Click event I am adding the control to the parent form.  The code is below:

Me.gcCampaignContainer.Controls.Add(uControl)

uControl.BringToFront()

uControl.Dock = DockStyle.Fill

The uControl contains the combobox and BO.


StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Most likely, it's either the order in which you're adding the user control to the form or the ParentContainer property on the user control.  So, what you need to do is add the user control before the OnLoad (Load event) of the form and when you create and add the user control, set the ParentContainer property on the user control to the form.  Then, when the Load event fires on the form, the combo box will know to populate itself.
Jeff Pagley
Jeff Pagley
Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)
Group: StrataFrame Users
Posts: 223, Visits: 893
I scanned the forum, but could not find my particular issue addressed. I have a DevX SF wrapped combobox on a SF User control.  I am programmically adding the user control to a form.  Along with the combobox I have textboxes on the control also.  The textboxes show the data from the BO object, but the combobox does not.  To make sure I was not missing something in the combobox settings and had all of the data binding setup correctly, I put the combobox and the same BO on a SF Maintenance form with the exact same settings and the combobox populates correctly.  What is going on?

Thanks!

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search