Customizing Appearance
Accessing and customizing elements can be performed either at design time, or at run time. Before proceeding with this topic, it is recommended to get familiar with the visual structure of the RadDataEntry.
Design Time
You can access and modify the style for different elements in RadDataEntry by using the Element Hierarchy Editor
.
Fig.1 Element Hierarchy Editor
Programmatically
The following snippet show how you can customize the RadDataEntry styles at runtime.
Change Border Color
radDataEntry1.DataEntryElement.Border.ForeColor = ColorTranslator.FromHtml("#e83737");
radDataEntry1.DataEntryElement.Border.ForeColor = ColorTranslator.FromHtml("#e83737")
Fig2. The changed border.
Changing The Styles Of The Underlying Controls.
The following snippet shows how you access the underlying controls and change the their styles:
Set Labels ForeColor
foreach (RadPanel item in radDataEntry1.PanelContainer.Controls)
{
foreach (RadControl control in item.Controls)
{
if (control is RadLabel)
{
control.ForeColor = ColorTranslator.FromHtml("#e83737");
}
}
}
For Each item As RadPanel In radDataEntry1.PanelContainer.Controls
For Each control As RadControl In item.Controls
If TypeOf control Is RadLabel Then
control.ForeColor = ColorTranslator.FromHtml("#e83737")
End If
Next control
Next item
Fig3. Set Labels ForeColor.