Hi,
i am using a Ultragrid - in one Column a UltraComboEditor is used as EditorComponent.The UltraComboEditor is set for multiple selection with checkboxes.
The Problem: the result of the ultracomboeditor is always the DisplayTEXT not the selected VALUES (IDs)
Example of the Content of the List:ID: 100s_Bezeichnung: "Kostenstelle 1"
wrong result: "KostenstelleA; KostenstelleB; KostenstelleC" right result: "100;200;300"
In the Database should be saved the IDs of the CheckedItems: 100;200;300
Definition of the UltraComboEditor:
Me.cboKStValueList.CheckedListSettings.CheckBoxStyle = Infragistics.Win.CheckStyle.CheckBoxMe.cboKStValueList.CheckedListSettings.EditorValueSource = Infragistics.Win.EditorWithComboValueSource.CheckedItemsMe.cboKStValueList.CheckedListSettings.ItemCheckArea = Infragistics.Win.ItemCheckArea.ItemMe.cboKStValueList.CheckedListSettings.ListSeparator = ";"Me.cboKStValueList.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList
Me.cboKStValueList.DataSource = cls_ZE_global.lstKStMe.cboKStValueList.DisplayMember = "s_Bezeichnung"Me.cboKStValueList.ValueMember = "ID"
Setting the UltraComboEditor as EditorComponent
For Each col As Infragistics.Win.UltraWinGrid.UltraGridColumn In ugResult.DisplayLayout.Bands(0).Columns Select Case col.Key case "s_KSt" col.EditorComponent = cboKStValueList...
Thanks for your help!
Mike Fleisch
i found a dirty solution on my own - but would be glad, if there is a better way
I am using to strings for this
s_KSt_MultiSel ... contains the IDs, read and save from dbs_KSt_MultiSel_Display ... contains the translated Display-Values
After the cell has changed, the original IDs are set manually
Private Sub ugZulagenJeTag_AfterCellUpdate(sender As Object, e As CellEventArgs) Handles ugZulagenJeTag.AfterCellUpdate Try If e.Cell.Column.Key = "" Then Dim cls As cls_ZE_ZulagenJeTag = e.Cell.Row.ListObject If cls IsNot Nothing AndAlso Me.ugZulagenJeTag.Rows(0).Cells("s_KSt_MultiSel_Display").EditorComponentResolved IsNot Nothing Then cls.s_KSt_MultiSel = "" For Each itm As ValueListItem In DirectCast(Me.ugZulagenJeTag.Rows(0).Cells("s_KSt_MultiSel_Display").EditorComponentResolved, UltraComboEditor).CheckedItems cls.s_KSt_MultiSel &= itm.DataValue & ";" Next End If End If Catch ex As Exception Dim errhandler As New ErrorHandler errhandler.HandleError(ex) End Try End Sub
Greets, Mike
The valuelist of the combo has a ValueDisplayStyle that you can set to DataValue.
eg.
(ultraComboEditor1.ValueList as Infragistics.Win.ValueList ).DisplayStyle = ValueListDisplayStyle.DataValue;