Hi Alexander
I use this senario for create editable RadComboBoxEditor. But I need to inheritance from two class !
please see this code :
01.
namespace
RadGridViewComboEditorCS
02.
{
03.
04.
public
class
MyComboBoxEditor : RadDropDownListEditor
05.
{
06.
protected
override
RadElement CreateEditorElement()
07.
{
08.
return
new
MyComboBoxEditorElement();
09.
}
10.
}
11.
public
class
MyComboBoxEditorElement : RadDropDownListEditorElement
12.
{
13.
14.
protected
override
void
ProcessKeyDown(
object
sender, System.Windows.Forms.KeyEventArgs e)
15.
{
16.
if
( e.KeyCode == Keys.Enter || e.KeyCode==Keys.Tab)
17.
{
18.
MessageBox.Show(
"yes"
);
19.
BindingList<
string
> stringsDataSource = (BindingList<
string
>)
this
.DataSource;
20.
string
currentText =
this
.Text;
21.
22.
if
(!ExistsInDataSource(currentText, stringsDataSource))
23.
{
24.
stringsDataSource.Add(
this
.Text);
25.
this
.SelectedIndex =
this
.Items.Count - 1;
26.
return
;
27.
}
28.
}
29.
base
.ProcessKeyDown(sender, e);
30.
}
31.
32.
private
bool
ExistsInDataSource(
string
currentText, BindingList<
string
> dataSource)
33.
{
34.
for
(
int
i = 0; i < dataSource.Count; i++)
35.
{
36.
if
(currentText == dataSource[i])
37.
{
38.
return
true
;
39.
}
40.
}
41.
42.
return
false
;
43.
}
44.
}
45.
}
in your code
1.
public
class
CustomGridBehavior : BaseGridBehavior
so how can i inheritance from two class ( BaseGridBehavior and RadDropDownListEditorElement ) ?
BaseGridBehavior : for keys.KeyCode == Keys.Tab
RadDropDownListEditorElement for create editable RadComboBoxEditor
Thanks Telerik .