Oct
13
Written by:
Steve Gray
10/13/2010 3:25 PM
Code to add a row to a Janus Multicolumn Dropdown
If you already have a data table, we’ll just add a row to that table
Me.ddlArchAssignedTo.DisplayMember = "SLPRSNID"
Me.ddlArchAssignedTo.ValueMember = "SLPRSNID"
Dim oDT As DataTable
oDT = dynData.SPs.FP_RM00301_SEL_ArchReps(AppUser.connectionString).getTable
Dim oRow As DataRow = oDT.NewRow
oRow("slprsnid") = "All"
oDT.Rows.Add(oRow)
Me.ddlArchAssignedTo.DataSource = oDT
Me.ddlArchAssignedTo.Value = "All"
This code will bind to a ListItemCollection
Dim list As GridEXValueListItemCollection
list = New GridEXValueListItemCollection
list.Add(New GridEXValueListItem("buyerid", "buyerid"))
list.Add(New GridEXValueListItem("dscriptn", "dscriptn"))
Me.ddlBuyerID.DataSource = list
If there is no data source, we’ll create a table manually and bind to that.
Dim oDT As New DataTable
'create column 1
Dim decimals As DataColumn = New DataColumn("decimals", System.Type.GetType("System.Int16"))
oDT.Columns.Add(decimals)
'create the rows
Dim oRow As DataRow
oRow = oDT.NewRow
oRow("decimals") = "1"
oDT.Rows.Add(oRow)
oRow = oDT.NewRow
oRow("decimals") = "2"
oDT.Rows.Add(oRow)
Me.ddlTimeEntryDecimals.DataSource = oDT
Me.ddlTimeEntryDecimals.ValueMember = "decimals"
Me.ddlTimeEntryDecimals.DisplayMember = "decimals"