Binding an Enhanced List at runtime


Author
Message
Andria Jensen
Andria Jensen
StrataFrame User (406 reputation)StrataFrame User (406 reputation)StrataFrame User (406 reputation)StrataFrame User (406 reputation)StrataFrame User (406 reputation)StrataFrame User (406 reputation)StrataFrame User (406 reputation)StrataFrame User (406 reputation)StrataFrame User (406 reputation)
Group: Forum Members
Posts: 336, Visits: 497
I'm trying to use a generic form to maintain several different tables in the database.  They all use the same form, but just different data sources.  What is the best way to do this in code at run-time instead of setting it through the designer at design time?  I figure I need to set some properties of the PopulationDataSourceSettings, but what I'm doing hasn't been working.  Here's the code I've got so far to bind the grid, and maybe someone can tell me what I have missing.

Public Class frmSFTableBase
   Public Sub New(ByVal HdrBO As BusinessLayer, ByVal HdrValue As String) 
      Me
.BusinessObjects.Add(HdrBO)
     
Me.grdHdr.PopulationDataSourceSettings.BusinessObjectType = "BBS.Biz.BizTypeBO"      Me.grdHdr.PopulationDataSourceSettings.ValueMember = HdrValue
     
Me.grdHdr.PopulationDataSourceSettings.MethodToExecute = "FillDataTable()"
     
Me.grdHdr.PopulationDataSourceSettings.DisplayFieldNames.Add(HdrValue)
      Me
.grdHdr.PopulationDataSourceSettings.FormatColumns.Add("{0}", MicroFour.StrataFrame.UI.ListViewColumnPopulationType.FormattedString)
      Me
.InitializeComponent()

End Sub

   Private Sub grdHdr_ListPopulating(ByVal e As   MicroFour.StrataFrame.UI.ListPopulatingEventArgs) Handles grdHdr.ListPopulating

       e.Parameters(0).Value =
"SELECT * FROM BizType"
 
End Sub

End Class

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