Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
95
Using a UltraComboEditor with checkboxes as a EditorComponent of a UltraGrid Column.
posted

I use a UltraComboEditor control with checkboxes as a EditorComponent of a UltraGrid Column.

The UltraGrid Column is bound to a SQL Server varchar(1000) column.

I want to display inside this column a series of Bank Branches, the user can check the Branches he wants and two things should happen:

1. The UltraGrid Cell should display the selected Branches (using DisplayMember values separated by  the defined ListSeparator: ";"). This happens fine, I see for example: BRANCH 200;BRANCH 201;BRANCH 202;BRANCH 203

2. The relevant data cell  should contain the selected Branch's IDs (using ValueMember values) separated by  the defined ListSeparator: ";" for example: 200;201;202;203. This doesn't happen. Instead I get the same value BRANCH 200;BRANCH 201;BRANCH 202;BRANCH 203 as above.

A sample of the code I use is:

            uceActiveForBranchList.DataSource = dsReports.Tables(0)
            uceActiveForBranchList.DisplayMember = "BranchDescr"
            uceActiveForBranchList.ValueMember = "BranchId"
            uceActiveForBranchList.CheckedListSettings.CheckBoxStyle = CheckStyle.CheckBox
            uceActiveForBranchList.CheckedListSettings.EditorValueSource = EditorWithComboValueSource.CheckedItems
            uceActiveForBranchList.CheckedListSettings.ListSeparator = ";"
            uceActiveForBranchList.CheckedListSettings.ItemCheckArea = ItemCheckArea.CheckBox
            e.Layout.Bands(0).Columns("ActiveForBranchList").EditorComponent = uceActiveForBranchList

I use version 10.1.20101.2053 of Infragistics2.Win.UltraWinEditors.v10.1

and Infragistics2.Win.UltraWinGrid.v10.1 components.

What can I do to make this work as I want?

Parents
  • 20872
    Offline posted

    Hello Probank,

    I have been looking into this forum thread, and it seems to me that you would like to display in the dropdown "BRANCH 200", "BRANCH 201", etc., while when the customer clicks on the checkbox and adds the item the the checked items, the control should display then 200;201;.. etc. If this is right you could use the UltraCombo control instead of the UltraComboEditor.

    I have created the required code snippet that achieve similar look and feel. You could change it in your sample and verify if this is the desired one: 


    ultraCombo1.DataSource = dt ultraCombo1.DisplayLayout.Bands(0).Columns("ID").Hidden = True
    ultraCombo1.DisplayLayout.Bands(0).ColHeadersVisible = False
    Dim c As UltraGridColumn = Me.ultraCombo1.DisplayLayout.Bands(0).Columns.Add() c.Key = "bool"; c.DataType = GetType(Boolean)
    c.Header.VisiblePosition = 0
    ultraCombo1.ValueMember = "ID"
    ultraCombo1.CheckedListSettings.EditorValueSource = Infragistics.Win.EditorWithComboValueSource.CheckedItems ultraCombo1.CheckedListSettings.CheckStateMember = "bool" ultraCombo1.CheckedListSettings.ListSeparator = ";" ultraCombo1.CheckedListSettings.ItemCheckArea = Infragistics.Win.ItemCheckArea.CheckBox


    If you have any other questions with this matter please feel free to let us know.

Reply Children