Assembly: System.Windows.Forms (in system.windows.forms.dll)
/** @property */ public DataGridViewRow get_RowTemplate () /** @property */ public void set_RowTemplate (DataGridViewRow value)
public function get RowTemplate () : DataGridViewRow public function set RowTemplate (value : DataGridViewRow)
Property ValueA DataGridViewRow representing the row template.
Sometimes you want greater control over the appearance of DataGridView rows than what is provided by the various DataGridView cell style properties. The RowTemplate property lets you create and initialize a DataGridViewRow for use as a template by all rows, including the row for new records if AllowUserToAddRows is true.
This is useful when you are setting default values for properties such as row height. For example, you may want to increase the default row height in order to provide extra room beneath ordinary cell content for displaying content that spans multiple columns.
Setting the row template is necessary when external data is displayed using custom types derived from the DataGridViewRow class. With unbound DataGridView controls, you can programmatically populate the Rows collection with instances of your custom row type. When displaying external data, however, the rows are generated automatically, but they are based on the row template, which you can set to an instance of your custom row type.
If this property has not been set the first time you retrieve its value, a new DataGridViewRow is created and returned.
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.