Product Bundles
DevCraft
All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:
Web
Mobile
Document Management
Desktop
Reporting
Testing & Mocking
CMS
UI/UX Tools
Debugging
Free Tools
Support and Learning
Productivity and Design Tools
public
partial
class
RadForm1 : Telerik.WinControls.UI.RadForm
{
RadForm1()
InitializeComponent();
BindingList<ColorInfo> colorNames =
new
BindingList<ColorInfo>();
colorNames.Add(
ColorInfo() { ColorName =
"Red"
});
"Green"
"Blue"
BindingSource source =
BindingSource();
source.DataSource = colorNames;
radBindingNavigator1.BindingSource = source;
Binding binding =
Binding(
"Value"
, source,
"ColorName"
,
true
);
binding.Format += binding_Format;
binding.Parse += binding_Parse;
radColorBox1.DataBindings.Add(binding);
}
void
binding_Format(
object
sender, ConvertEventArgs e)
string
val = e.Value.ToString();
switch
(val)
case
:
e.Value = Color.Red;
break
;
e.Value = Color.Blue;
e.Value = Color.Green;
default
e.Value = Color.FromArgb(
int
.Parse(e.Value.ToString()));
binding_Parse(
e.Value = ((Color)e.Value).ToArgb().ToString();
ColorInfo
ColorName {
get
set
; }