Click or drag to resize

GridHelpers class

This class provides DependencyProperties for the number of rows and columns of WPF grids is available. This makes it possible to change the number of columns and rows of grids at runtime via databinding. I have taken the logic almost unchanged from Rachel Lim's blog on https://rachel53461.wordpress.com/2011/09/17/wpf-grids-rowcolumn-count-properties/ adopted. Thanks and respect to Rachel Lim on https://rachel53461.wordpress.com/
Inheritance hierarchy
SystemObject
  Vishnu.WPF_UI.DependencyPropertiesGridHelpers

Namespace: Vishnu.WPF_UI.DependencyProperties
Assembly: Vishnu.WPF_UI (in Vishnu.WPF_UI.dll) Version: 1.0.0+df0404e911d6c38eaed3bb1bb1acfc482d417643
Syntax
public static class GridHelpers

The GridHelpers Type exposes the following members.

Methods
 NameDescription of the
Public MethodStatic MemberColumnCountChanged Change Event - Adds the columns.
Public MethodStatic MemberColumnsPropertiesChanged Change Event - Makes specified Column's Width equal to Auto or Star depending on GridHelpers._gridColumnUnitType.
Public MethodStatic MemberGetColumnCount Returns the actual ColumnCount of a given grid.
Public MethodStatic MemberGetColumnsProperties Returns a string representing the value of the ColumnsPropertiesProperty of a given Grid.
Public MethodStatic MemberGetRowCount Returns the actual RowCount of a given Grid.
Public MethodStatic MemberGetRowsProperties Returns a string representing the value of the RowsPropertiesProperty of a given Grid.
Public MethodStatic MemberRowCountChanged Change Event - Adds the Rows.
Public MethodStatic MemberRowsPropertiesChanged Change Event - Makes the specified Row's Height equal to Auto or Star depending on GridHelpers._gridRowUnitType.
Public MethodStatic MemberSetColumnCount Sets the ColumnCount of a given Grid to the given value.
Public MethodStatic MemberSetColumnsProperties Sets the new value of the ColumnsPropertiesProperty of a given Grid.
Public MethodStatic MemberSetRowCount Sets the RowCount of a given Grid to the given value.
Public MethodStatic MemberSetRowsProperties Sets the new value of the RowsPropertiesProperty of a given Grid.
Back to the top
Fields
 NameDescription of the
Public FieldStatic MemberColumnCountProperty Adds the specified number of Columns to ColumnDefinitions. Default Width is Auto.
Public FieldStatic MemberColumnsPropertiesProperty Makes the specified Column's Width equal to Auto or Star depending on GridHelpers._gridColumnUnitType. Can set on multiple columns.
Public FieldStatic MemberRowCountProperty Adds the specified number of Rows to RowDefinitions. Default Height is Auto.
Public FieldStatic MemberRowsPropertiesProperty Makes the specified Row's Height equal to Auto or Star depending on GridHelpers._gridRowUnitType. Can set on multiple Rows.
Back to the top
Attached properties
 NameDescription of the
Public PropertyColumnCount Adds the specified number of Columns to ColumnDefinitions. Default Width is Auto.
Public PropertyColumnsProperties Makes the specified Column's Width equal to Auto or Star depending on GridHelpers._gridColumnUnitType. Can set on multiple columns.
Public PropertyRowCount Adds the specified number of Rows to RowDefinitions. Default Height is Auto.
Public PropertyRowsProperties Makes the specified Row's Height equal to Auto or Star depending on GridHelpers._gridRowUnitType. Can set on multiple Rows.
Back to the top
Remarks
03.10.2022 Erik Nagel: created.
See also