$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
DataGridView for C#.NET WinForms
Create custom data grid cells to GirdView in C# for your .NET Windows Forms applications
Home > WinForms UI Controls > User Manual > Iterating Grid Cells in C#

Iterating Cells to C# DataGirdView

The Cells are the units representing data in Kettic DataGridView for C# Windows Forms application. While using the DataGridView component, users can easily customize and edit the cells for data grid and design amazing cells user interface for their C# Windows Forms application. The Kettic GridView Control allows users easily accessing, iterating, merging, formatting cells as well as creating custom cells for their Data Grid in .NET projects.

Iterate through Grid Cells in C#

The C# DataGridView allows users of it to iterate via data cells by using the objects, Cells collection of GridViewCellInformation. We are going through the example as below that iterate the rows in the grid first and then iterate the cells for each row in the GridView.
C# code for iterating cells to GridView control in Windows Forms application

foreach (GridViewRowInformation rowInformation in ketticGridView1.Rows)
{
foreach (GridViewCellInfo cellInfo in ketticInformation.Cells)
{
if ((cellInfo.ColumnInformation.Name == "ProductCategory")
|| (cellInfo.ColumnInformation.Name == "ProductName")
{
cellInfo.Value = "Test Value";
}
}
}
The DataGirdView control uses virtualization to display the visual elements, so that only grid rows currently visible have a visual element. And when we scroll the grid, the visual elements will be reused. It is safe to use the CellElement only inside the CellFormatting event and for the current GridView cells. It will fire the CellFormatting event each time while updating the state of the grid cell to GridView component.
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