Why is this weirdness needed?


Author
Message
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.5K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I pulled this code form the code that loads a combo/list from an enum (I think). There is mention of some .NET weirdness that requires this. I'm wondering if you could shed a bit of light on why this is done? (Setting the display member and value member to ZLS, then to their actual values, then setting datasource, then setting them again!)





Private Sub SetDataSource(ByVal combo As SF.ComboBox _

, ByVal DataSource As Object _

, ByVal DisplayMember As String _

, ByVal ValueMember As String)

combo.BeginUpdate()

combo.DataSource = Nothing

combo.DisplayMember = String.Empty

combo.ValueMember = String.Empty

combo.DisplayMember = DisplayMember

combo.ValueMember = ValueMember

combo.DataSource = DataSource

combo.DisplayMember = DisplayMember

combo.ValueMember = ValueMember

combo.EndUpdate()

End Sub


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