Interface IPropertyGrid
Specialized grid for editing properties - in other words name = value pairs.
public interface IPropertyGrid
Remarks
List of ready-to-use property classes include strings, numbers, flag sets, fonts, colors and many others. It is possible, for example, to categorize properties, set up a complete tree-hierarchy, add more than two columns, and set arbitrary per-property attributes.
Properties
- ApplyFlags
Gets or sets flags used when property value is applied back to object instance in default PropertyChanged event handler.
- BoolAsCheckBox
Gets or sets whether boolean properties will be shown as checkboxes. Default is
true
.
- ColorHasAlpha
Gets or sets whether Color properties have alpha chanel. Default is
true
.
- CreateStyle
Defines visual style and behavior of the PropertyGrid control.
- CreateStyleEx
Defines extended style of the PropertyGrid control.
- EventColumn
Gets column index on which event is fired.
- EventPropName
Gets property name used in the event handler.
- EventPropValue
Gets property value used in the event handler.
- EventPropValueAsVariant
Gets property value used in the event handler as IPropertyGridVariant.
- EventProperty
Gets property used in the event handler.
- EventValidationFailureBehavior
Gets or sets validation failure behavior flags used in the event handler.
- EventValidationFailureMessage
Gets or sets validation failure message used in the event handler.
- Factory
Returns IPropertyGridFactory instance.
- Handler
Gets control handler.
- HasBorder
Gets or sets a value indicating whether the control has a border.
- IgnorePropNames
Contains list of property names to ignore in AddProps(object?, IPropertyGridItem?, bool).
- Items
Gets list of IPropertyGridItem added to this control.
Methods
- Add(IPropertyGridItem, IPropertyGridItem?)
Adds item to the property grid.
- AddActionTrigger(PropertyGridKeyboardAction, Key, ModifierKeys)
Adds new action trigger (keyboard key association).
- AddProps(object, IPropertyGridItem?, bool)
Adds all public properties of the specified object.
- AddRange(IEnumerable<IPropertyGridItem>, IPropertyGridItem?)
Adds items to the property grid.
- AddToSelection(IPropertyGridItem)
Adds given property into selection.
- AppendIn(IPropertyGridItem, IPropertyGridItem)
Appends property as a child of other property.
- ApplyColors(IPropertyGridColors?)
Sets all PropertyGrid colors.
- ApplyKnownColors(PropertyGridKnownColors)
Sets all PropertyGrid colors.
- BackgroundToLineColor()
Changes lines color to the cell background color;
- BeginLabelEdit(int)
Creates label editor for given column, for property that is currently selected.
- CenterSplitter(bool)
Centers the splitter.
- ChangePropertyValue(IPropertyGridItem, object)
Changes value of a property, as if from an editor.
- ChangePropertyValueAsVariant(IPropertyGridItem, IPropertyGridVariant)
Changes value of a property, as if from an editor.
- Clear()
Deletes all items from the property grid.
- ClearActionTriggers(PropertyGridKeyboardAction)
Removes added action triggers for the given action.
- Collapse(IPropertyGridItem)
Collapses (hides) all sub properties of the given property.
- CreateBoolItem(string, string?, bool, IPropertyGridNewItemParams?)
Creates bool property.
- CreateByteItem(string, string?, byte, IPropertyGridNewItemParams?)
Creates byte property.
- CreateCharItem(string, string?, char?, IPropertyGridNewItemParams?)
Creates char property.
- CreateChoicesItem(string, string?, IPropertyGridChoices, object?, IPropertyGridNewItemParams?)
Creates enumeration property.
- CreateColorItem(string, string?, Color, IPropertyGridNewItemParams?)
Creates Color property.
- CreateDirItem(string, string?, string?, IPropertyGridNewItemParams?)
Creates string property with ellipsis button which opens SelectDirectoryDialog when pressed.
- CreateDoubleItem(string, string?, double, IPropertyGridNewItemParams?)
Creates double property.
- CreateEditEnumItem(string, string?, IPropertyGridChoices, string?, IPropertyGridNewItemParams?)
Creates editable enumeration property.
- CreateFilenameItem(string, string?, string?, IPropertyGridNewItemParams?)
Creates string property with ellipsis button which opens FileDialog when pressed.
- CreateFlagsItem(string, string?, IPropertyGridChoices, object?, IPropertyGridNewItemParams?)
Creates flags property (like enumeration with Flags attribute).
- CreateFloatItem(string, string?, float, IPropertyGridNewItemParams?)
Creates float property.
- CreateImageFilenameItem(string, string?, string?, IPropertyGridNewItemParams?)
Creates string property with ellipsis button which opens FileDialog when pressed.
- CreateInt16Item(string, string?, short, IPropertyGridNewItemParams?)
Creates short property.
- CreateIntItem(string, string?, int, IPropertyGridNewItemParams?)
Creates int property.
- CreateLongItem(string, string?, long, IPropertyGridNewItemParams?)
Creates long property.
- CreateLongStringItem(string, string?, string?, IPropertyGridNewItemParams?)
Creates string property with additional edit dialog for entering long values.
- CreatePropCategory(string, string?, IPropertyGridNewItemParams?)
Creates properties category.
- CreateProperty(object, PropertyInfo)
Creates property using another object's property.
- CreateProperty(object, string)
Creates property using another object's property.
- CreateProperty(string?, string?, object, PropertyInfo)
Creates property using another object's property.
- CreateProperty(string?, string?, object, string)
Creates property using another object's property.
- CreatePropertyAsBool(string, string?, object, PropertyInfo)
Creates bool property.
- CreatePropertyAsBrush(string, string?, object, PropertyInfo)
Creates Brush property.
- CreatePropertyAsByte(string, string?, object, PropertyInfo)
Creates byte property.
- CreatePropertyAsChar(string, string?, object, PropertyInfo)
Creates char property.
- CreatePropertyAsColor(string?, string?, object, PropertyInfo)
Creates Color property.
- CreatePropertyAsDate(string, string?, object, PropertyInfo)
Creates DateTime property.
- CreatePropertyAsDecimal(string, string?, object, PropertyInfo)
Creates decimal property.
- CreatePropertyAsDouble(string, string?, object, PropertyInfo)
Creates double property.
- CreatePropertyAsEnum(string?, string?, object, PropertyInfo)
Creates enumeration property.
- CreatePropertyAsFloat(string, string?, object, PropertyInfo)
Creates float property.
- CreatePropertyAsFont(string, string?, object, PropertyInfo)
Creates Font property.
- CreatePropertyAsInt(string, string?, object, PropertyInfo)
Creates int property.
- CreatePropertyAsInt16(string, string?, object, PropertyInfo)
Creates short property.
- CreatePropertyAsLong(string, string, object, PropertyInfo)
Creates long property.
- CreatePropertyAsPen(string, string?, object, PropertyInfo)
Creates Pen property.
- CreatePropertyAsSByte(string, string?, object, PropertyInfo)
Creates sbyte property.
- CreatePropertyAsString(string, string?, object, PropertyInfo)
Creates string property.
- CreatePropertyAsStruct(string, string?, object, PropertyInfo)
Creates property for structures.
- CreatePropertyAsUInt(string, string?, object, PropertyInfo)
Creates uint property.
- CreatePropertyAsUInt16(string, string?, object, PropertyInfo)
Creates ushort property.
- CreatePropertyAsULong(string, string?, object, PropertyInfo)
Creates ulong property.
- CreateProps(object, bool)
Creates IPropertyGridItem array from all public properties of the specified object.
- CreateSByteItem(string, string?, sbyte, IPropertyGridNewItemParams?)
Creates sbyte property.
- CreateSystemColorItem(string, string?, Color, IPropertyGridNewItemParams?)
Creates Color property with system colors.
- CreateUInt16Item(string, string?, ushort, IPropertyGridNewItemParams?)
Creates ushort property.
- CreateUIntItem(string, string?, uint, IPropertyGridNewItemParams?)
Creates uint property.
- CreateULongItem(string, string?, ulong, IPropertyGridNewItemParams?)
Creates ulong property.
- DedicateKey(Key)
Dedicates a specific keycode to PropertyGrid. This means that such key presses will not be redirected to editor controls.
- DisableProperty(IPropertyGridItem)
Disables property.
- EditorsValueWasModified()
Call when editor widget's contents is modified.
- EnableCategories(bool)
Enables or disables (shows/hides) categories according to parameter enable.
- EnableProperty(IPropertyGridItem, bool)
Changes enabled state of the property.
- EndLabelEdit(bool)
Ends label editing, if any.
- EnsureVisible(IPropertyGridItem)
Scrolls and/or expands items to ensure that the given item is visible.
- Expand(IPropertyGridItem)
Expands (shows) all sub properties of the given property.
- FitColumns()
Reduces column sizes to minimum possible, while still retaining fully visible grid contents (labels, images).
- GetColumnCount()
Gets number of columns currently on grid.
- GetColumnProportion(int)
Gets auto-resize proportion of the given column.
- GetCommonValueCount()
Gets number of common values.
- GetCommonValueLabel(int)
Gets label of given common value.
- GetFontHeight()
Gets height of highest characters of used font.
- GetImageRect(IPropertyGridItem, int)
Returns rectangle of custom paint image.
- GetImageSize(IPropertyGridItem?, int)
Returns size of the custom paint image in front of property.
- GetItemsFiltered(object?, PropertyInfo?)
Gets IPropertyGridItem added to the control filtered by Instance (
instance
param) and PropInfo (propInfo
param).
- GetLastItem(PropertyGridIteratorFlags)
Returns last item which could be iterated using given flags.
- GetMarginWidth()
Gets margin width.
- GetPropNameAsLabel()
Gets special property name which means to use label as property name.
- GetPropertyBackgroundColor(IPropertyGridItem)
Gets background color of first cell of a property.
- GetPropertyClientData(IPropertyGridItem)
Gets client data associated with the property.
- GetPropertyHelpString(IPropertyGridItem)
Gets help string associated with the property.
- GetPropertyLabel(IPropertyGridItem)
Gets label associated with the property.
- GetPropertyName(IPropertyGridItem)
Gets property name of the IPropertyGridItem.
- GetPropertyTextColor(IPropertyGridItem)
Returns text color of first cell of a property.
- GetPropertyValueAsBool(IPropertyGridItem)
Gets property value as bool.
- GetPropertyValueAsDateTime(IPropertyGridItem)
Gets property value as DateTime.
- GetPropertyValueAsDouble(IPropertyGridItem)
Gets property value as double.
- GetPropertyValueAsInt(IPropertyGridItem)
Gets property value as int.
- GetPropertyValueAsLong(IPropertyGridItem)
Gets property value as long.
- GetPropertyValueAsString(IPropertyGridItem)
Gets property value as string.
- GetPropertyValueAsULong(IPropertyGridItem)
Gets property value as ulong.
- GetPropertyValueAsVariant(IPropertyGridItem)
Gets property value as IPropertyGridVariant.
- GetRoot()
Returns "root property".
- GetRowHeight()
Gets height of a single grid row (in pixels).
- GetSelectedProperty()
Gets currently selected property.
- GetSpacingY()
Gets current Y spacing.
- GetSplitterPosition(int)
Gets current splitter x position.
- GetUnspecifiedCommonValue()
Gets index of common value that will truly change value to unspecified.
- GetUnspecifiedValueText(PropertyGridValueFormatFlags)
Returns (visual) text representation of the unspecified property value.
- GetVerticalSpacing()
Gets current vertical spacing.
- HasVirtualWidth()
Gets whether control has virtual width specified with SetVirtualWidth(int).
- HideProperty(IPropertyGridItem, bool, bool)
Hides or shows property.
- Insert(IPropertyGridItem, IPropertyGridItem)
Inserts property before another property.
- InsertAt(IPropertyGridItem, int, IPropertyGridItem)
Inserts property in parent property at specified index.
- IsAnyModified()
Gets whether any property has been modified by the user.
- IsEditorFocused()
Gets whether a property editor control has focus.
- IsEditorsValueModified()
Gets whether editor's value was marked modified.
- IsPropertyCategory(IPropertyGridItem)
Gets whether property is category.
- IsPropertyEnabled(IPropertyGridItem)
Gets whether property is enabled.
- IsPropertyExpanded(IPropertyGridItem)
Gets whether property is expanded.
- IsPropertyModified(IPropertyGridItem)
Gets whether property is modified.
- IsPropertySelected(IPropertyGridItem)
Gets whether property is selected.
- IsPropertyShown(IPropertyGridItem)
Gets whether property is shown.
- IsPropertyValueUnspecified(IPropertyGridItem)
Gets whether property value is unspecified.
- LimitPropertyEditing(IPropertyGridItem, bool)
Disables (limit = true) or enables (limit = false) text editor of a property, if it is not the sole mean to edit the value.
- MakeColumnEditable(int, bool)
Makes given column editable by user.
- RefreshEditor()
Refreshes any active editor control.
- RefreshProperty(IPropertyGridItem)
Redraws given property.
- ReloadPropertyValue(IPropertyGridItem)
Reloads value of the IPropertyGridItem item if it is attached to the external object (Instance and PropInfo) are not null.
- ReloadPropertyValues(object?, PropertyInfo?)
Reloads values of all IPropertyGridItem items collected with GetItemsFiltered(object?, PropertyInfo?).
- RemoveFromSelection(IPropertyGridItem)
Removes given property from selection.
- RemoveProperty(IPropertyGridItem)
Removes property from the PropertyGrid.
- ReplaceProperty(IPropertyGridItem, IPropertyGridItem)
Replaces existing property with newly created property.
- ResetColors()
Resets all colors used in PropertyGrid to default values.
- ResetColumnSizes(bool)
Resets column sizes and splitter positions, based on proportions.
- RestoreEditableState(string, PropertyGridEditableState)
Restores user-editable state.
- SaveEditableState(PropertyGridEditableState)
Used to acquire user-editable state (selected property, expanded properties, scrolled position, splitter positions).
- SelectProperty(IPropertyGridItem, bool)
Selects a property.
- SetColumnCount(int)
Sets number of columns (2 or more).
- SetColumnProportion(int, int)
Sets proportion of an auto-stretchable column.
- SetCurrentCategory(IPropertyGridItem)
Sets the 'current' category - Add(IPropertyGridItem, IPropertyGridItem?) will add non-category properties under it.
- SetPropertyAttribute(IPropertyGridItem, string, object?, PropertyGridItemValueFlags)
Sets an attribute for the property.
- SetPropertyAttributeAll(string, IPropertyGridVariant)
Sets an attribute for all the properties.
- SetPropertyAttributeAll(string, object)
Sets an attribute for all the properties.
- SetPropertyAttributeAsVariant(IPropertyGridItem, string, IPropertyGridVariant, PropertyGridItemValueFlags)
Sets an attribute for the property.
- SetPropertyBackgroundColor(IPropertyGridItem, Color, bool)
Sets background colour of a property.
- SetPropertyClientData(IPropertyGridItem, IntPtr)
Sets client data of a property.
- SetPropertyColorsToDefault(IPropertyGridItem, bool)
Resets text and background colors of a property.
- SetPropertyEditorByName(IPropertyGridItem, string)
Sets editor control of a property using its name.
- SetPropertyHelpString(IPropertyGridItem, string)
Sets help string of a property.
- SetPropertyImage(IPropertyGridItem, ImageSet?)
Sets image associated with the property.
- SetPropertyKnownAttribute(IPropertyGridItem, PropertyGridItemAttrId, object?, PropertyGridItemValueFlags)
Sets known attribute for the property.
- SetPropertyLabel(IPropertyGridItem, string)
Sets label of a property.
- SetPropertyMaxLength(IPropertyGridItem, int)
Sets maximum length of text in property text editor.
- SetPropertyMinMax(IPropertyGridItem, object?, object?)
Sets minimal and maximal values of the numeric property.
- SetPropertyMinMax(IPropertyGridItem, TypeCode)
Sets minimal and maximal values of the numeric property.
- SetPropertyReadOnly(IPropertyGridItem, bool, bool)
Sets property readonly flag.
- SetPropertyTextColor(IPropertyGridItem, Color, bool)
Sets text colour of a property.
- SetPropertyValidator(IPropertyGridItem, IValueValidator)
Sets validator of a property.
- SetPropertyValueAsBool(IPropertyGridItem, bool)
Sets property value as bool.
- SetPropertyValueAsDateTime(IPropertyGridItem, DateTime)
Sets property value as DateTime.
- SetPropertyValueAsDouble(IPropertyGridItem, double)
Sets property value as double.
- SetPropertyValueAsInt(IPropertyGridItem, int)
Sets property value as int.
- SetPropertyValueAsLong(IPropertyGridItem, long)
Sets property value as long.
- SetPropertyValueAsStr(IPropertyGridItem, string)
Sets property value as string.
- SetPropertyValueAsVariant(IPropertyGridItem, IPropertyGridVariant)
Sets property value as variant.
- SetPropertyValueUnspecified(IPropertyGridItem)
Allows property value to be unspecified.
- SetProps(object?, bool)
Clears properties and calls AddProps(object?, IPropertyGridItem?, bool) afterwards.
- SetSplitterLeft(bool)
Moves splitter as left as possible, while still allowing all labels to be shown in full.
- SetSplitterPosition(int, int)
Sets x coordinate of the splitter.
- SetUnspecifiedCommonValue(int)
Sets index of common value that will truly change value to unspecified.
- SetValidationFailureBehavior(PropertyGridValidationFailure)
Adjusts how PropertyGrid behaves when invalid value is entered in a property.
- SetVerticalSpacing(int?)
Sets vertical spacing.
- SetVirtualWidth(int)
Set virtual width for this particular page.
- Sort(bool)
Sorts properties.
- SortChildren(IPropertyGridItem, bool)
Sorts children of a property.
- UnfocusEditor()
Unfocuses or closes editor if one was open, but does not deselect property.
- WasValueChangedInEvent()
You can use this function, for instance, to detect in events if property's SetValueInEvent was already called in editor's event handler.
Events
- ButtonClick
Occurs when button is clicked in the property editor.
- ColBeginDrag
Occurs when user starts resizing a column.
- ColDragging
Occurs when a column resize by the user is in progress. This event is also generated when user double-clicks the splitter in order to recenter it.
- ColEndDrag
Occurs after column resize by the user has finished.
- ItemCollapsed
Occurs when user collapses a property or category.
- ItemExpanded
Occurs when user expands a property or category.
- LabelEditBegin
Occurs when user is about to begin editing a property label.
- LabelEditEnding
Occurs when user is about to end editing of a property label.
- ProcessException
Occurs when exception is raised inside AvoidException(Action).
- PropertyChanged
Occurs when property value has been changed by the user.
- PropertyChanging
Occurs when property value is about to be changed by the user.
- PropertyDoubleClick
Occurs when property is double-clicked with left mouse button.
- PropertyHighlighted
Occurs when mouse moves over a property.
- PropertyRightClick
Occurs when property is clicked with right mouse button.
- PropertySelected
Occurs when a property selection has been changed, either by user action or by indirect program function.