Hi
I am having difficulty binding a RibbonBar ComboBox to a DataTable. I have created the RibbonBar control at Design-Time but all other objects are created at Run-Time for various application reasons.
I am able to create a ribbonbar, tab, chunk and combobox objects. The radComboBoxElement does not display in my chunk unless i set the autosize property to False and manually set the size property. I set the datasource, displaymember and valuememeber properties to valid entries as I would a normal combobox, but at runtime the combobox does not populate.
I have recreated the problem in a sample project below. I would appreciate any assistance anyone is able to offer. I have searched the forums but cannot find any articles specific to this issue.
Regards
Brendan
I am having difficulty binding a RibbonBar ComboBox to a DataTable. I have created the RibbonBar control at Design-Time but all other objects are created at Run-Time for various application reasons.
I am able to create a ribbonbar, tab, chunk and combobox objects. The radComboBoxElement does not display in my chunk unless i set the autosize property to False and manually set the size property. I set the datasource, displaymember and valuememeber properties to valid entries as I would a normal combobox, but at runtime the combobox does not populate.
I have recreated the problem in a sample project below. I would appreciate any assistance anyone is able to offer. I have searched the forums but cannot find any articles specific to this issue.
Regards
Brendan
| Imports Telerik.WinControls |
| Imports Telerik.WinControls.UI |
| Public Class Form1 |
| Friend tab1 As New TabItem |
| Friend commandtab1 As New RadRibbonBarCommandTab |
| Friend chunk1 As New RadRibbonBarChunk |
| Friend combo1 As New RadComboBoxElement |
| Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load |
| Dim conSQLConnection As New SqlClient.SqlConnection("DATA SOURCE=SQLSERVER.DOMAIN.COM;Integrated Security=SSPI;INITIAL CATALOG=Table1") |
| Dim adpTable1Adapter As New SqlClient.SqlDataAdapter("SELECT * FROM Table1", conSQLConnection) |
| Dim tblTable1 As New DataTable |
| conSQLConnection.Open() |
| adpExpressAdapter.Fill(tblExpressComputers) |
| tab1.Text = "Tab 1" |
| commandtab1.Tab = tab1 |
| ribbon1.CommandTabs.Add(commandtab1) |
| chunk1.Text = "Chunk 1" |
| commandtab1.Items.Add(chunk1) |
| combo1.AutoSize = False |
| combo1.Size = New Drawing.Size(100, 20) |
| combo1.DataSource = tblTable1Computers |
| combo1.ValueMember = "computer_id" |
| combo1.DisplayMember = "name" |
| chunk1.Items.Add(combo1) |
| End Sub |