Site Search:
Sign in | Join | Help
4Penny.net

Janus System

All things for all Janus products

July 2007 - Posts

  • Setting a default value for a Janus multcolumncombo

    To set a default value for a Janus Multicolumn combo, set the value property, as:

    Me.cboVendorClass.Value = "Masonry"

     

  • Adding a multicolumn dropdown to a Janus grid

    This is a walk through for adding a multicolumn dropdown control to a Janus grid.

    Add a grid to a form, and populate it.

    In the grid designer, click on 'DropDowns' and 'add' one. Go through the wizard and add the columns.

    At the dropdown level, be sure that the 'key', 'valuemember' and 'displaymember' properties are popluated

    Under 'RootTable/Columns', click on the column where the dropdown will go.

    Under Combo Settings, populate 'dropdown'

    Under Display, poplulate 'EditButtonDisplayMode' as 'always'

    Under Edit, set 'EditMode' as 'MulticolumnDropDown'

    In the code behind, poplulate the grid.

    After that code, populate the dropdown like this:
    Dim oDS As New DataSet

    oDS = oProjectCost.BidHeader_SEL_vendors(strJobNumber)

    Me.GridEX1.DropDowns("cboVendor").DataSource = oDS.Tables(0)

    Me.GridEX1.DropDowns("cboVendor").DisplayMember = "vchrVendorName"

    Me.GridEX1.DropDowns("cboVendor").ValueMember = "vchrVendorID"


    The value member is the name of the id column in the dropdown.

     

    The dropdown has to contain all the possible values that can be in there, and have to be filtered somehow. In this schema, we filter by one of the columns

    Private Sub GridEX1_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridEX1.SelectionChanged
    If GridEX1.SelectedItems(0).RowType = Janus.Windows.GridEX.RowType.Record Then

    'when a user changes which row is selected the filter needs to be changed to
    'match the current rows classification
    Dim filter As New GridEXFilterCondition
    filter.Column = GridEX1.DropDowns(
    "cboVendor").Columns("vchrItemNumber")
    filter.ConditionOperator = ConditionOperator.Equal
    filter.Value1 =
    Me.GridEX1.GetValue("itemnmbr")
    GridEX1.DropDowns(
    "cboVendor").ApplyFilter(filter)

    End If

    End Sub