Vantage 8 Ultra Combo Customization

I've added an UltraCombo (ucbMatlType) to my Part Maint. screen. Here's
where I've gotten with this so far...

Private Sub PartForm_Load(ByVal sender As Object, ByVal args As
EventArgs) Handles PartForm.Load

Dim tblMaterials As DataTable = New DataTable("Materials")
Dim MatlTypes As DataColumn = New DataColumn("MatlType")
MatlTypes.DataType = System.Type.GetType("System.String")
tblMaterials.Columns.Add(MatlTypes)

ucbMatlType.DataSource = tblMaterials

NewTableRow(tblMaterials, "MatlType", "")
NewTableRow(tblMaterials, "MatlType", "HR")
NewTableRow(tblMaterials, "MatlType", "SS")
NewTableRow(tblMaterials, "MatlType", "AL")
NewTableRow(tblMaterials, "MatlType", "SP")

End Sub

Private Sub NewTableRow(DestTable As DataTable, ColumnName As String,
NewItem As String)

Dim NewRow As DataRow
NewRow = DestTable.NewRow()
NewRow.Item(ColumnName) = NewItem
DestTable.Rows.Add(NewRow)

End Sub

My intent is to add more funtionality so that my UltraCombo's in Part
Maintenance change their content based on user inputs.

--- In vantage@yahoogroups.com, "Steven Pybus" <steven@...> wrote:
>
> Thanks Frederic. I found your code on the forum yesterday. I was
> looking for a more direct route but after playing with it, I may be
> able to make it work just the same. I'm now trying to create a
> subroutine that will add a itmes to an UltraCombo.
>
> One question: What do the .ValueMember & .DisplayMember properties
> do for you in this example?
>
> Thanks,
> Steve P.
>
> --- In vantage@yahoogroups.com, "Frederic Naslis" fnaslis@
> wrote:
> >
> > Here i populate a combobox in the customer form :
> >
> >
> > Private Sub CustomerEntryForm_Load(ByVal sender As object, ByVal
> args As
> > EventArgs) Handles CustomerEntryForm.Load
> >
> > '// Creating a table named Customers
> > Dim tblCards As DataTable
> > tblCards = New DataTable("Cards")
> >
> > '// Declaring three rows for the table
> > Dim Row1, Row2, Row3 As DataRow
> >
> > '// Declaring a column named Code
> > Dim CardID As DataColumn = New DataColumn("CardID")
> >
> > '// Setting the datatype for the column
> > CardID.DataType = System.Type.GetType("System.String")
> >
> > '// Adding the column to table
> > tblCards.Columns.Add(CardID)
> >
> > '// Declaring a column named Name
> > Dim CardName As DataColumn = New DataColumn("CardName")
> >
> > '// Setting the datatype for the column
> > CardName.DataType = System.Type.GetType("System.String")
> >
> > '// Adding the column to table
> > tblCards.Columns.Add(CardName)
> >
> > '// Filling the row with values. Item property is used to
> set the
> > field value and add it .
> > Row1 = tblCards.NewRow()
> > Row1.Item("CardID") = "AMEX"
> > Row1.Item("CardName") = "American Express"
> > tblCards.Rows.Add(Row1)
> >
> > Row2 = tblCards.NewRow()
> > Row2.Item("CardID") = "MC"
> > Row2.Item("CardName") = "MasterCard"
> > tblCards.Rows.Add(Row2)
> >
> > Row3 = tblCards.NewRow()
> > Row3.Item("CardID") = "Visa"
> > Row3.Item("CardName") = "Visa"
> > tblCards.Rows.Add(Row3)
> >
> > cmbCreditCard.ValueMember = "CardID"
> > cmbCreditCard.DisplayMember = "CardName"
> > cmbCreditCard.SetColumnFilter("CardName")
> > cmbCreditCard.DataSource = tblCards
> >
> > End Sub
> >
> >
> >
> > On 5/8/07, Steven Pybus steven@ wrote:
> > >
> > > Does anybody have access to documentation on the customization
> tools?
> > > I'm looking for a way to modify the contents of an ultra combo
> > > pulldown during runtime. All of the VBA, VB6 and .net that I've
> > > worked with in the past have provided .AddItem methods or some
> way to
> > > change the pulldown list contents based on runtime conditions.
> > >
> > > The only way I see of doing this is to...
> > > 1 create a table,
> > > 2 populate that with the data and
> > > 3 change the combo's datasource.
> > >
> > > Any way of doing this the easy way?
> > >
> > > Thanks,
> > > Steve P.
> > >
> > >
> > >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>




[Non-text portions of this message have been removed]
Does anybody have access to documentation on the customization tools?
I'm looking for a way to modify the contents of an ultra combo
pulldown during runtime. All of the VBA, VB6 and .net that I've
worked with in the past have provided .AddItem methods or some way to
change the pulldown list contents based on runtime conditions.

The only way I see of doing this is to...
1 create a table,
2 populate that with the data and
3 change the combo's datasource.

Any way of doing this the easy way?

Thanks,
Steve P.
Here i populate a combobox in the customer form :


Private Sub CustomerEntryForm_Load(ByVal sender As object, ByVal args As
EventArgs) Handles CustomerEntryForm.Load

'// Creating a table named Customers
Dim tblCards As DataTable
tblCards = New DataTable("Cards")

'// Declaring three rows for the table
Dim Row1, Row2, Row3 As DataRow

'// Declaring a column named Code
Dim CardID As DataColumn = New DataColumn("CardID")

'// Setting the datatype for the column
CardID.DataType = System.Type.GetType("System.String")

'// Adding the column to table
tblCards.Columns.Add(CardID)

'// Declaring a column named Name
Dim CardName As DataColumn = New DataColumn("CardName")

'// Setting the datatype for the column
CardName.DataType = System.Type.GetType("System.String")

'// Adding the column to table
tblCards.Columns.Add(CardName)

'// Filling the row with values. Item property is used to set the
field value and add it .
Row1 = tblCards.NewRow()
Row1.Item("CardID") = "AMEX"
Row1.Item("CardName") = "American Express"
tblCards.Rows.Add(Row1)

Row2 = tblCards.NewRow()
Row2.Item("CardID") = "MC"
Row2.Item("CardName") = "MasterCard"
tblCards.Rows.Add(Row2)

Row3 = tblCards.NewRow()
Row3.Item("CardID") = "Visa"
Row3.Item("CardName") = "Visa"
tblCards.Rows.Add(Row3)

cmbCreditCard.ValueMember = "CardID"
cmbCreditCard.DisplayMember = "CardName"
cmbCreditCard.SetColumnFilter("CardName")
cmbCreditCard.DataSource = tblCards

End Sub



On 5/8/07, Steven Pybus <steven@...> wrote:
>
> Does anybody have access to documentation on the customization tools?
> I'm looking for a way to modify the contents of an ultra combo
> pulldown during runtime. All of the VBA, VB6 and .net that I've
> worked with in the past have provided .AddItem methods or some way to
> change the pulldown list contents based on runtime conditions.
>
> The only way I see of doing this is to...
> 1 create a table,
> 2 populate that with the data and
> 3 change the combo's datasource.
>
> Any way of doing this the easy way?
>
> Thanks,
> Steve P.
>
>
>


[Non-text portions of this message have been removed]
Thanks Frederic. I found your code on the forum yesterday. I was
looking for a more direct route but after playing with it, I may be
able to make it work just the same. I'm now trying to create a
subroutine that will add a itmes to an UltraCombo.

One question: What do the .ValueMember & .DisplayMember properties
do for you in this example?

Thanks,
Steve P.

--- In vantage@yahoogroups.com, "Frederic Naslis" <fnaslis@...>
wrote:
>
> Here i populate a combobox in the customer form :
>
>
> Private Sub CustomerEntryForm_Load(ByVal sender As object, ByVal
args As
> EventArgs) Handles CustomerEntryForm.Load
>
> '// Creating a table named Customers
> Dim tblCards As DataTable
> tblCards = New DataTable("Cards")
>
> '// Declaring three rows for the table
> Dim Row1, Row2, Row3 As DataRow
>
> '// Declaring a column named Code
> Dim CardID As DataColumn = New DataColumn("CardID")
>
> '// Setting the datatype for the column
> CardID.DataType = System.Type.GetType("System.String")
>
> '// Adding the column to table
> tblCards.Columns.Add(CardID)
>
> '// Declaring a column named Name
> Dim CardName As DataColumn = New DataColumn("CardName")
>
> '// Setting the datatype for the column
> CardName.DataType = System.Type.GetType("System.String")
>
> '// Adding the column to table
> tblCards.Columns.Add(CardName)
>
> '// Filling the row with values. Item property is used to
set the
> field value and add it .
> Row1 = tblCards.NewRow()
> Row1.Item("CardID") = "AMEX"
> Row1.Item("CardName") = "American Express"
> tblCards.Rows.Add(Row1)
>
> Row2 = tblCards.NewRow()
> Row2.Item("CardID") = "MC"
> Row2.Item("CardName") = "MasterCard"
> tblCards.Rows.Add(Row2)
>
> Row3 = tblCards.NewRow()
> Row3.Item("CardID") = "Visa"
> Row3.Item("CardName") = "Visa"
> tblCards.Rows.Add(Row3)
>
> cmbCreditCard.ValueMember = "CardID"
> cmbCreditCard.DisplayMember = "CardName"
> cmbCreditCard.SetColumnFilter("CardName")
> cmbCreditCard.DataSource = tblCards
>
> End Sub
>
>
>
> On 5/8/07, Steven Pybus <steven@...> wrote:
> >
> > Does anybody have access to documentation on the customization
tools?
> > I'm looking for a way to modify the contents of an ultra combo
> > pulldown during runtime. All of the VBA, VB6 and .net that I've
> > worked with in the past have provided .AddItem methods or some
way to
> > change the pulldown list contents based on runtime conditions.
> >
> > The only way I see of doing this is to...
> > 1 create a table,
> > 2 populate that with the data and
> > 3 change the combo's datasource.
> >
> > Any way of doing this the easy way?
> >
> > Thanks,
> > Steve P.
> >
> >
> >
>
>
> [Non-text portions of this message have been removed]
>
Hi steven,

In .NET ValueMember = "DataValueField" and DisplayMember = "DataTextField"

In fact you tell to the object that you work with the "ValueMember" but you
display the "DisplayMember"
If you bind the combo with the table customers and fied shortchar01 the
"ValueMember" is stored but it display the "DisplayMember"

Hope this help.



On 5/8/07, Steven Pybus <steven@...> wrote:
>
> Thanks Frederic. I found your code on the forum yesterday. I was
> looking for a more direct route but after playing with it, I may be
> able to make it work just the same. I'm now trying to create a
> subroutine that will add a itmes to an UltraCombo.
>
> One question: What do the .ValueMember & .DisplayMember properties
> do for you in this example?
>
> Thanks,
> Steve P.
>
> --- In vantage@yahoogroups.com <vantage%40yahoogroups.com>, "Frederic
> Naslis" <fnaslis@...>
> wrote:
> >
> > Here i populate a combobox in the customer form :
> >
> >
> > Private Sub CustomerEntryForm_Load(ByVal sender As object, ByVal
> args As
> > EventArgs) Handles CustomerEntryForm.Load
> >
> > '// Creating a table named Customers
> > Dim tblCards As DataTable
> > tblCards = New DataTable("Cards")
> >
> > '// Declaring three rows for the table
> > Dim Row1, Row2, Row3 As DataRow
> >
> > '// Declaring a column named Code
> > Dim CardID As DataColumn = New DataColumn("CardID")
> >
> > '// Setting the datatype for the column
> > CardID.DataType = System.Type.GetType("System.String")
> >
> > '// Adding the column to table
> > tblCards.Columns.Add(CardID)
> >
> > '// Declaring a column named Name
> > Dim CardName As DataColumn = New DataColumn("CardName")
> >
> > '// Setting the datatype for the column
> > CardName.DataType = System.Type.GetType("System.String")
> >
> > '// Adding the column to table
> > tblCards.Columns.Add(CardName)
> >
> > '// Filling the row with values. Item property is used to
> set the
> > field value and add it .
> > Row1 = tblCards.NewRow()
> > Row1.Item("CardID") = "AMEX"
> > Row1.Item("CardName") = "American Express"
> > tblCards.Rows.Add(Row1)
> >
> > Row2 = tblCards.NewRow()
> > Row2.Item("CardID") = "MC"
> > Row2.Item("CardName") = "MasterCard"
> > tblCards.Rows.Add(Row2)
> >
> > Row3 = tblCards.NewRow()
> > Row3.Item("CardID") = "Visa"
> > Row3.Item("CardName") = "Visa"
> > tblCards.Rows.Add(Row3)
> >
> > cmbCreditCard.ValueMember = "CardID"
> > cmbCreditCard.DisplayMember = "CardName"
> > cmbCreditCard.SetColumnFilter("CardName")
> > cmbCreditCard.DataSource = tblCards
> >
> > End Sub
> >
> >
> >
> > On 5/8/07, Steven Pybus <steven@...> wrote:
> > >
> > > Does anybody have access to documentation on the customization
> tools?
> > > I'm looking for a way to modify the contents of an ultra combo
> > > pulldown during runtime. All of the VBA, VB6 and .net that I've
> > > worked with in the past have provided .AddItem methods or some
> way to
> > > change the pulldown list contents based on runtime conditions.
> > >
> > > The only way I see of doing this is to...
> > > 1 create a table,
> > > 2 populate that with the data and
> > > 3 change the combo's datasource.
> > >
> > > Any way of doing this the easy way?
> > >
> > > Thanks,
> > > Steve P.
> > >
> > >
> > >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
>
>


[Non-text portions of this message have been removed]