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
365
EditorWithCombo - DropDownList
posted

Hello,

Is it possible to create an EditorWithCombo that uses style DropDownList? 

We have an UltraTree that is populated based on a DataSet.

Which we then configure to use the EditorWithCombo. However, we do not want the user to be able to type in values that are not in the list.

utStoreSizes.SetDataBinding(dsStoreSizes"Table");
            utStoreSizes.Override.CellClickAction = CellClickAction.EditCell;
 
            UltraTreeColumnSet pColSet = utStoreSizes.Nodes.ColumnSetResolved;
pColSet.Columns["PartNo"].AllowCellEdit = AllowCellEdit.Full;
            ValueList valList = new ValueList();
 
            ValueListItem valItem = null;
            foreach (DataRow dr in dsStockSizes.Tables[0].Rows)
            {
                valItem = valList.ValueListItems.Add(dr, (string)dr["PartNo"+ " - " + (string)dr["Description"]);
                valItem.Tag = (string)dr["PartNo"];
            }
 
            foreach (DataRow drStore in dsStoreSizes.Tables[0].Rows)            
                drStore["Select"= 0;            
 
            pColSet.Columns["PartNo"].ValueList = valList;
            EditorWithCombo cbEditor = ((EditorWithCombo)pColSet.Columns["PartNo"].EditorResolved);
            cbEditor.KeyDown -= new KeyEventHandler(cellEdit_KeyDown);
            cbEditor.KeyDown += new KeyEventHandler(cellEdit_KeyDown);
            cbEditor.ButtonDisplayStyle = Infragistics.Win.ButtonDisplayStyle.OnMouseEnter;
            cbEditor.AfterCloseUp += new EventHandler(MachineSetup_AfterCloseUp);
            cbEditor.AfterEnterEditMode += new EventHandler(Editor_AfterEnterEditMode);
            cbEditor.BeforeExitEditMode += new BeforeExitEditModeEventHandler(cbEditor_BeforeExitEditMode);

Any assistance would be greatly appreciated, I apologize if this has been asked, but I did not see a resolution.

  • 469350
    Offline posted

    Hi,

    The EditorWithCombo is an embeddable editor and so it's DropDownStyle is determine by it's owner - in this case, the TreeNodeColumn.

    So check to see if the column you are assigning the editor to has DropDownStyle property.

    If it does not, then you can still do it, but you have to use an UltraCombo Control instead of EditorWithCombo. And set the DropDownStyle on the UltraCombo control to DropDownList.