How to set the number of rows or columns
9 Dec 2019 / 1 minute to read
Dynamically changing the RowCount or ColCount properties while a GridControl is being displayed is an efficient way to add or remove rows and/or columns from a GridControl. Using the designer, set grid’s RowCount and ColCount properties. From code, set these properties after the call to InitializeComponent in the form’s constructor (or anytime later in your code after the GridControl has been created).
public Form1()
{
//Requires for Windows Form Designer support.
InitializeComponent();
//Sets the number of rows.
gridControl1.RowCount = 20;
//Sets the number of columns.
gridControl1.ColCount = 200;
}
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Adds any initialization after the InitializeComponent() call.
'Sets the number of rows.
GridControl1.RowCount = 20
'Sets the number of columns.
GridControl1.ColCount = 200
End Sub
Was this page helpful?
Yes
No
Thank you for your feedback!
Thank you for your feedback and comments. We will rectify this as soon as possible!
An unknown error has occurred. Please try again.
Help us improve this page