I have a Combobox tool on a tab in my Ribbon and I am wondering how I can fill it from a MS access datasource?
Second question can this be a two collumns valuelist and can the keyvalue collumn be hidden.
this in VB.Net
Hi,
You could do this using a BindableValueList. What you do is create the BindableValueList in code and then assign it to the ValueList property of the ComboBoxTool.
Dim dt As DataTable = New DataTable dt.Columns.Add("Key", GetType(Integer)) dt.Columns.Add("Text", GetType(String)) Dim dr As DataRow = dt.Rows.Add() dr("Key") = 0 dr("Text") = "Apple" dr = dt.Rows.Add() dr("Key") = 1 dr("Text") = "Banana" dr = dt.Rows.Add() dr("Key") = 2 dr("Text") = "Cherry" dt.AcceptChanges() Dim vl As BindableValueList = New BindableValueList() vl.DataSource = dt vl.ValueMember = "Key" vl.DisplayMember = "Text" vl.BindingContextControl = Me Dim myComboBoxTool As ComboBoxTool = DirectCast(Me.UltraToolbarsManager1.Tools("ComboBoxTool1"), ComboBoxTool) myComboBoxTool.ValueList = vl
Thanks Mike,
That really helped I'm new at using infragistics toolset and had now training wathso ever. My next question is related the comboboxtool is filled and displayed like it should how can I retreave the value the user selected to be able to process it.
Regards
Ronny Gilisen
Hi Ronny,
Cast the tool into a ComboBoxTool (just as I did in my sample code) and then user the properties on that tool like Value, SelectedItem, or SelectedIndex. Just as you would for any ComboBox.
Dear Mike,
Please help me about combobox on ribbon
I was setting value list in combobox are:
Now, i retrieve get value about that but i don't find method or properties to get its. Please help me.
Thanks,
Ps: i'm using C# on VS 2008.
So what you would do is get the tool from the ToolbarsManager and cast it into a ComboBocTool. Then check the Value property.
ComboBoxTool comboBoxTool = (ComboBoxTool)this.UltraToolbarsManager1.Tools["My Combobox Tool"];
Debug.Writeline(comboBoxTool.Value);
I mean,: I'm trying to get value or index of Item in Combobox Tool on ribbon Tool Bar to compare. :).
Sorry about inconvenient,
Thanks
nghiemnd said:Now, i retrieve get value about that but i don't find method or properties to get its.
I do not understand your question. There appear to be some words missing from your last sentence.