$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
DataGridView WinForms Component
Customize Style and Appearance of GridView in C#.NET Applications.
Home > WinForms UI Controls > User Manual > Image for Grid Apprearance in C#

GridView Images

Kettic GridView .NET WinForms control allows the users to display a few images to indicate the status of a grid row. This is accomplished by using the Image property included in the GridView component. The Image property is able to use an image to indicate the current row in grid, display an image to indicate the row in edit mode in grid, show an image to tell us that an error occurred, and use an image to indicate the new row in grid.

Properties of Displaying Image in GridView

To display the image in grid row to indicate the status, we need to use the properties as below included in the GridView. The detailed descriptions are followed with each property.
  • CurrentRowHeaderImage, this property will display the image to indicate the current row in GridView
  • EditRowHeaderImage, this property is able to show the image to indicate as Kettic GridView is in the mode of editing
  • ErrorRowHeaderImage, this property is used to display the image for indicating an error that may be caused while validating data
  • NewRowHeaderImage, this property will display the image to indicate the new row in grid

Change Images in C# for GridView

The above properties allow us to change the image. To change the images with the properties, we can use the C# code below.

((GridTableElement)this.ketticGridView1.TableElement).CurrentRowHeaderImage = Image.FromFile("..\\KetticDemoData\\currentrow.jpg");
((GridTableElement)this.ketticGridView1.TableElement).EditRowHeaderImage = Image.FromFile("..\\KetticDemoData\\rowediting.gif");
((GridTableElement)this.ketticGridView1.TableElement).ErrorRowHeaderImage = Image.FromFile("..\\KetticDemoData\\error.gif");
((GridTableElement)this.ketticGridView1.TableElement).NewRowHeaderImage = Image.FromFile("..\\KetticDemoData\\newrow.png");

Set Image in Column Header in GridView

The C# code snippet below shows how to set an image in a column header.

ketticGridView1.Columns["Date"].HeaderImage = Image.FromFile("..\\KetticDemoData\\new.png");
ketticGridView1.Columns["Date"].TextImageRelation = TextImageRelation.ImageAboveText;
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