Hello,
I've noticed a small problem with the commandbar controls and databinding. Maybe this is not a bug, but however the commandbar controls behave different to the "normal" (Telerik) controls.
If you have something like this:
public
partial
class
RadForm1 : Telerik.WinControls.UI.RadForm
{
public
RadForm1()
{
InitializeComponent();
List<myobject> source =
new
List<myobject>();
BindingSource binding =
new
BindingSource();
source.Add(
new
myobject(1,
"a"
));
source.Add(
new
myobject(2,
"b"
));
source.Add(
new
myobject(3,
"c"
));
source.Add(
new
myobject(4,
"d"
));
try
{
commandBarTextBox1.DataBindings.Add(
"Text"
, binding,
"MyProperty2"
,
true
, DataSourceUpdateMode.OnValidation);
}
catch
{
}
radTextBox1.DataBindings.Add(
"Text"
, binding,
"MyProperty2"
,
true
, DataSourceUpdateMode.OnValidation);
binding.DataSource = source;
binding.MoveLast();
}
}
public
class
myobject
{
public
int
MyProperty1 {
get
;
set
; }
public
string
MyProperty2 {
get
;
set
; }
public
myobject(
int
a,
string
b)
{
MyProperty1 = a;
MyProperty2 = b;
}
}
the databinding of the commandbartextbox will crash but the radtextbox works fine.The problem is that the binding datasource is set after the control databinding.
Since the radcontrols and the .net controls work fine in this case it would be nice if the commandbar controls could too.
(Why are the commandbarcontrols not derived from the radcontrols? or at least have the same base class?)
Kind Regards,
Christian