Вопрос

I have to do some maintenance on an VB.NET application (Visual Studio 2012) that uses Infragistics.

I need to modify column in an existing UltraGrid control. One of the column is already a dropdown and now it should be changed to Multicolumn dropdown, allowing the selection from a list of values.

I modified the column, and now i'm thinking what to be set in the the Style?. I created a ValueList and assigned it to the new column.

How to achieve this?

Note: I tried like setting the type as dropdown and binding the valuelist but it shows only the first column in the dropdown which is retrieved in the result.

Это было полезно?

Решение

Basically you need to use a UltraCombo, not a ValueList. This is an example on how to do it, but lacks of many details like how to retrieve the values from a datatable that you need to supply

private Sub grid_InitializeLayout(object sender, InitializeLayoutEventArgs e) Handles InitializeLayout
    Dim yourTable As DataTable = GetYourDataTable()
    Dim combo = new UltraCombo()
    combo.DataSource = yourTable
    combo.DisplayMember = "Field_name_To_Display"
    combo.ValueMember = "Field_name_that_binds_combo_table_To_grid_Column"
    ' Now supposing the column that needs the combo is the first one of your grid
    e.Layout.Bands(0).Columns(0).ValueList = combo
End Sub
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top