All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:
Hello there!
The function of the control itself it's pretty straightforward, however, it seems that it does not have the ability of binding to a data source. Is there any possible workaround?.
Thanks in advance.
Product p;
Random rand =
new
Random();
public
Form1()
{
InitializeComponent();
p =
Product(123,
"Orange"
, 12.45m);
this
.radLabel1.Text = p.ToString();
.radSpinEditor1.DecimalPlaces = 2;
.radSpinEditor1.DataBindings.Add(
"Value"
, p,
"Price"
,
true
, DataSourceUpdateMode.OnPropertyChanged);
}
private
void
radButton1_Click(
object
sender, EventArgs e)
p.Price = rand.Next(0, 20) * 0.45m;
class
Product: System.ComponentModel.INotifyPropertyChanged
event
PropertyChangedEventHandler PropertyChanged;
protected
virtual
OnPropertyChanged(
string
propertyName)
if
(PropertyChanged !=
null
)
PropertyChanged(
PropertyChangedEventArgs(propertyName));
int
_id;
_name;
decimal
_price;
Id
get
return
set
(
._id != value)
._id = value;
"Id"
);
Name
._name != value)
._name = value;
"Name"
Price
._price != value)
._price = value;
Product(
id,
name,
price)
.Id = id;
.Name = name;
.Price = price;
override
ToString()
"Name: "
+
.Name +
" Price: "
.Price;