DataGridView for C#.NET WinForms Create custom data grid cells to GirdView in C# for your .NET Windows Forms applications Setting GridView Cells in C#.NET
The Kettic DataGridView control allows users of the DataGridView control to access and set grid data cells in C# Windows Forms application. The Kettic DataGridView C#.NET control provides the CurrentRow and CurrentColumn properties to achieve the functionality of setting current grid cells and the DataGridCellElement to access the current grid data cell. In this article, we are going through the details of accessing and setting current grid cells in C#.NET template projects. Set Current Grid Cell in C#
While we are using the Kettic DataGridView control in our C# Windows Forms template projects, we can set the current grid cells to GridView by using the two properties, the CurrentRow and CurrentColumn. We need to the CurrentRow and CurrentColumn properties to respective grid row and grid column which cross at the desired cell in DataGridView.
C# code for setting the current cell to GridView component in Windows Forms application this.ketticGridView1.CurrentRow = this.ketticGridView1.Rows[1]; this.ketticGridView1.CurrentColumn = this.ketticGridView1.Columns[1]; this.Text = this.ketticGridView1.CurrentCell.Value.ToString();
Access Current Cell in C#
While we are using the DataGridView control in our C# Windows Forms template projects, we can access the current grid cells to GridView by creating a variable of type DataGridCellElement and assign the current grid cell to the element to get an instance of the current grid cell to C# DataGridView control.
C# code for accessing the current grid cell to GridView component in Windows Forms application GridDataCellElement cell = ketticGridView1.CurrentCell;
|