$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
DataGridView WinForms Control
Powerful GridView C#.NET control supports data binding to various data sources
Home > WinForms UI Controls > User Manual > Unbound Mode in C#

GridView Unbound Mode

The Kettic GridView component provides an Unbound Mode to prevent content generation from a data source. The Unbound Mode of GridView requires users to add and remove the grid columns and rows by using the provided C# API or the Kettic GridView user interface at design time. Furthermore, it is possible to create a grid which is like spreadsheet with empty rows and columns for end users entering data. In this mode, we can create unbound grids through setting the number of desired rows to RowCount property, using Cells collection and Rows collection to create grids and filling data to them.

Create Unbound Grid with Empty Data in C#

To create unbound mode grids rows and columns without any data which will be entered by users, we can follow the simple steps as below.
  • Add columns to Columns collection of the corresponding GridViewTemplate.
  • Set the number of desired rows to the RowCount property to the GridView.
  • The setting of the number of grid rows will not affect the grid. For example, when we set the number of grid rows as 20 to the RowCount property, and set 17 rows, the GridView will add 3 more empty rows to the gird for a total number to 20.
  • The C# code below shows how to create a grid with three columns and twenty rows

this.ketticGridView1.RowCount = 20;
this.ketticGridView1.Columns.Add(new GridViewTextBoxColumn("A"));
this.ketticGridView1.Columns.Add(new GridViewTextBoxColumn("B"));
this.ketticGridView1.Columns.Add(new GridViewTextBoxColumn("C"));
this.ketticGridView1.MasterTemplate.AllowAddNewRow = false;

Add Rows via Cells Collection in C#

The C# code below demonstrates how to add rows through Cells collection by creating columns, entering data for the cells in the grid row, and specifying the cell index and column name.

this.ketticGridView1.Columns.Add(new GridViewTextBoxColumn("A"));
this.ketticGridView1.Columns.Add(new GridViewTextBoxColumn("B"));
this.ketticGridView1.Columns.Add(new GridViewTextBoxColumn("C"));
GridViewRowInformation rowInformation = this.ketticGridView1.Rows.AddNew();
rowInformation.Cells[0].Value = "A1";
rowInformation.Cells[1].Value = "B1";
rowInformation.Cells[1].Value = "C1";
rowInformation = this.ketticGridView1.Rows.AddNew();
rowInformation.Cells["A"].Value = "A2";
rowInformation.Cells["B"].Value = "B2";
rowInformation.Cells["B"].Value = "C2";

Add Rows via Rows Collection in C#

The C# code below shows how to add data through Rows collection by using the Add method of the Rows collection.

this.ketticGridView1.Columns.Add(new GridViewTextBoxColumn("A"));
this.ketticGridView1.Columns.Add(new GridViewTextBoxColumn("B"));
this.ketticGridView1.Columns.Add(new GridViewTextBoxColumn("C"));
this.ketticGridView1.Rows.Add("A1", "B1", "C1");
this.ketticGridView1.Rows.Add("A2", "B2", "C2");
this.ketticGridView1.Rows.Add("A3", "B3", "C3");

Create Hierarchical Grid in Unbound Mode

To create hierarchical grid in unbound mode in C#, we can use the way that is similar to create hierarchical grid in bound mode. The differences are to set unbound mode itself and create columns first, and then set up the relation to hierarchical grid and load the data. The following are the C# code for creating hierarchical grid in unbound mode.
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