Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 84751

GridViewMultiComboBoxColumn Selection Problem

$
0
0

Hello,

I am having trouble with the GridViewMultiComboBoxColumn. I created a custom class inheriting from GridViewMultiComboBoxColumn but only to expose a method for my factory class. It is displaying the drop down correctly, however, once I've selected an item from the drop down, it does not reflect the selected value in the cell.

usingSystem;
usingActivitySchedule.Factory;
 
namespaceTelerik.WinControls.UI
{
    publicclassGridViewBoundObjectColumn : GridViewMultiComboBoxColumn
    {
        privatereadonlyType _type;
        publicbool_isColumnAdded;
 
        publicGridViewBoundObjectColumn(Type t)
        {
            _type = t;
        }
 
        publicvoidRadGridView_CellBeginEdit(objectsender, GridViewCellCancelEventArgs e)
        {
            var radGridView = sender asGridViewEditManager;
 
            if(e.ColumnIndex == this.Index)
            {
                if(!_isColumnAdded)
                {
                    _isColumnAdded = true;
                    RadMultiColumnComboBoxElement editor = (RadMultiColumnComboBoxElement)radGridView.ActiveEditor;
                    editor.EditorControl.MasterTemplate.AutoGenerateColumns = false;
                    editor.EditorControl.PopulateStructure(_type);
                    editor.AutoSizeDropDownToBestFit = true;
                }
            }
        }
    }
}

For testing I changed the GridViewMultiComboBoxColumn to a GridViewComboBoxColumn and set the DataSource, DisplayMember, and ValueMember the same way. It does reflect the selection in the cell but does not allow the user to see the extra fields when selecting from the drop down as with the GridViewMultiComboBoxColumn.

GridViewMultiComboBoxColumn.DataSource = BindingList<Foo>();

Any advice would be greatly appreciated. Banging my head on my desk at this point.


Viewing all articles
Browse latest Browse all 84751

Trending Articles