Private
Sub
LoadSupplierCombo()
Cursor = Cursors.WaitCursor
tsstatus.Text =
"Loading Suppliers, please wait..."
Refresh()
' cbSuppliers..MasterTemplate.AutoGenerateColumns = True
Dim
TicketsDA
As
SqlDataAdapter
Dim
TicketsDS
As
DataSet
Dim
TicketsDV
As
DataView
Dim
SQLString
As
String
=
""
DBOpen()
Try
SQLString =
"SELECT Supplier.SupplierName AS Supplier, Supplier.SupplierAccountNo AS [Account No] "
& _
"FROM SZTickets INNER JOIN "
& _
" SZTicketStatus ON SZTickets.statusId = SZTicketStatus.id INNER JOIN "
& _
" SZTicketPriority ON SZTickets.priorityId = SZTicketPriority.id INNER JOIN "
& _
" Supplier ON SZTickets.supplierId = Supplier.SupplierID "
& _
"GROUP BY Supplier.SupplierName, Supplier.SupplierAccountNo "
& _
"ORDER BY Supplier DESC"
Dim
SQLcmd
As
New
SqlCommand(SQLString, cnn1)
TicketsDA =
New
SqlDataAdapter(SQLcmd)
TicketsDS =
New
DataSet
TicketsDV =
New
DataView
TicketsDA.Fill(TicketsDS,
"Suppliers"
)
TicketsDV.Table = TicketsDS.Tables(
"Suppliers"
)
cbSuppliers.DataSource = TicketsDV
SQLcmd.Dispose()
TicketsDA.Dispose()
Catch
ex
As
Exception
g_error.DBErrorMsg(
"Failure to load tickets"
, SQLString, ex)
Finally
dgTickets.ResumeLayout()
DBClose()
End
Try
Cursor = Cursors.
Default
tsstatus.Text =
""
Dim
columns
As
RadMultiColumnComboBoxElement = cbSuppliers.MultiColumnComboBoxElement
For
Each
column
As
GridViewDataColumn
In
columns.Columns
column.BestFit()
Next
End
Sub
Hi
The above code loads my multi-column list box. However I would like to add <All Suppliers> at the beginning of the list as well as the supplier. I would like this to be the item selected on load.
Also, I cant find the equivalent command for combobox.items.clear()
How do I remove all the items?
Cheers
Baz