Hi Telerik Team
I customize to inherit GridViewMultiComboBoxColumn, BaseGridBehavior and RadMultiColumnComboBox. Example MeGridBehavior (inherited form BaseGridBehavior), MeGridViewMultiComboBoxColumn(inherited form GridViewMultiComboBoxColumn), MeMultiColumnComboBox (inherited form RadMultiColumnComboBox), MeMultiColumnComboBoxElement (inherit RadMultiColumnComboBoxElement)
when init GridView i set this.GridBehavior = new MeGridBehavior(), if column is Combobox editor i create MeGridViewMultiComboBoxColumn column and i override event OnEditorRequired and CreateMultiColunmnComboboxElement ;
When i click to another cell it throw exeption on mouseup event of MeGridBehavior
Unable to cast object of type 'MeMultiColumnComboBoxElement' to type 'Telerik.WinControls.UI.BaseGridEditor'.
at Telerik.WinControls.UI.GridViewEditManager.EndEditCore(Boolean validate, Boolean cancel)
at Telerik.WinControls.UI.GridViewEditManager.CloseEditor()
at Telerik.WinControls.UI.RadGridViewElement.CloseEditor()
at Telerik.WinControls.UI.GridRowBehavior.OnMouseUpLeft(MouseEventArgs e)
at Telerik.WinControls.UI.GridRowBehavior.OnMouseUp(MouseEventArgs e)
at Telerik.WinControls.UI.BaseGridBehavior.OnMouseUp(MouseEventArgs e)
at ......OnMouseUp(MouseEventArgs e) in d:\\MeProject\GridView\MeGridViewBehavior.cs
This error throw when I update to telerik rad control winforms version Q3 2013 but it work with version Q1 2013
Any one can help me !
Thanks .
I customize to inherit GridViewMultiComboBoxColumn, BaseGridBehavior and RadMultiColumnComboBox. Example MeGridBehavior (inherited form BaseGridBehavior), MeGridViewMultiComboBoxColumn(inherited form GridViewMultiComboBoxColumn), MeMultiColumnComboBox (inherited form RadMultiColumnComboBox), MeMultiColumnComboBoxElement (inherit RadMultiColumnComboBoxElement)
when init GridView i set this.GridBehavior = new MeGridBehavior(), if column is Combobox editor i create MeGridViewMultiComboBoxColumn column and i override event OnEditorRequired and CreateMultiColunmnComboboxElement ;
//On MeMultiColumnCombobox
protected
override
RadMultiColumnComboBoxElement CreateMultiColumnComboBoxElement()
{
return
new
MeMultiColumnComboBoxElement(
this
.Name,
this
);
}
// on GridView
protected
override
void
OnEditorRequired(
object
sender, EditorRequiredEventArgs e)
{
if
(
this
.CurrentColumn
is
MeGridViewMultiComboBoxColumn)
{
var column =
this
.CurrentColumn
as
MeGridViewMultiComboBoxColumn;
MeMultiColumnComboBox cbx= CreateDataComboBox(
"Countries"
);
e.Editor = cbx.MeMultiColumnComboBoxElement;
}
}
protected
override
void
OnCellValidating(
object
sender, CellValidatingEventArgs e)
{
//if value not in list of countries ?
var cbxCol = e.Column
as
MeGridViewMultiComboBoxColumn;
var detectError = ComboBoxValidating(text, e);
if
(detectError)
{
e.Cancel =
true
;
base
.OnCellValidating(sender,e);
ShowValidateError(
);
return
;
}
}
When i click to another cell it throw exeption on mouseup event of MeGridBehavior
Unable to cast object of type 'MeMultiColumnComboBoxElement' to type 'Telerik.WinControls.UI.BaseGridEditor'.
at Telerik.WinControls.UI.GridViewEditManager.EndEditCore(Boolean validate, Boolean cancel)
at Telerik.WinControls.UI.GridViewEditManager.CloseEditor()
at Telerik.WinControls.UI.RadGridViewElement.CloseEditor()
at Telerik.WinControls.UI.GridRowBehavior.OnMouseUpLeft(MouseEventArgs e)
at Telerik.WinControls.UI.GridRowBehavior.OnMouseUp(MouseEventArgs e)
at Telerik.WinControls.UI.BaseGridBehavior.OnMouseUp(MouseEventArgs e)
at ......OnMouseUp(MouseEventArgs e) in d:\\MeProject\GridView\MeGridViewBehavior.cs
This error throw when I update to telerik rad control winforms version Q3 2013 but it work with version Q1 2013
Any one can help me !
Thanks .