$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
PropertyGrid WinForms Control
Easily process properties of data objects, automatically generate and display custom data in C#.
Home > WinForms UI Controls > User Manual > Customize PropertyGrid Control in C#

PropertyGrid Customization in C#.NET

KetticPropertyGrid .NET component contains automatic generation and intuitive custom editors for the users to display and customize the data for their Windows Forms application. The users of the KetticPropertyGrid control are able to bind the control to a data item with a simple C# code snippet and set the properties as requirements and can set and customize the property editors using C# code and perform the scrolling operations through touch interface.

Styling Items in KetticPropertyGrid

KetticPropertyGrid control for Windows Forms contains several properties used to customize the style and appearance of the items in PropertyGrid. The customization also requires the ItemFormatting event. The properties used to customize the PropertyGrid item appearance includes,
  • ItemHeight, this property is used to control the height of the items in PropertyGrid.
  • ItemSpacing, this property is used to customize the distance between the items in Kettic PropertyGrid.
  • ItemIndent, this property is able to increase the indent before the items in any levels in Kettic PropertyGrid.
KetticPropertyGrid WinForms control applies the data virtualization like KetticGridView and KetticListControl, and the PropertyGrid Items are reusable, so we need to always reset the customized properties values to prevent the formatting being applied to other PropertyGrid items.

C# code Example for Customizing PropertyGrid items

The following is a sample which demonstrates how to change items colors and the sub items' back colors.

void ketticPropertyGrid1_ItemFormatting(object sender, PropertyGridItemFormattingEventArgs e)
{
if (e.Item.Level > 0)
{
e.VisualElement.BackColor = Color.Green;
}
else
{
e.VisualElement.ResetValue(LightVisualElement.BackColorProperty, Kettic.WinForms.ValueResetFlags.Local);
}
PropertyGridItem item = e.Item as PropertyGridItem;
if (item != null && item.Value != null)
{
if (item.Value.ToString() == "True")
{
e.VisualElement.BackColor = Color.LightGreen;
}
else if (item.Value.ToString() == "False")
{
e.VisualElement.BackColor = Color.Red;
}
}
else
{
e.VisualElement.ResetValue(LightVisualElement.BackColorProperty, Kettic.WinForms.ValueResetFlags.Local);
}
}
UI Controlsfor Windows Forms
.NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI Design
WinForms UI Controls