New to Telerik UI for WinForms? Start a free 30-day trial
Images
Updated over 6 months ago
RadGridView displays several images to indicate the status of a row:
-
CurrentRowHeaderImage: Image to indicate the current row.
-
EditRowHeaderImage: Image to indicate when RadGridView is in edit mode.
-
ErrorRowHeaderImage: Image to indicate an error caused on validation.
-
NewRowHeaderImage: Image to indicate the new row.
Changing the images programmatically
You can change the images using the properties shown below:
Changing the current row image
C#
((GridTableElement)this.radGridView1.TableElement).CurrentRowHeaderImage = Image.FromFile("..\\..\\DataSources\\separator.gif");
((GridTableElement)this.radGridView1.TableElement).EditRowHeaderImage = Image.FromFile("..\\..\\DataSources\\edit.png");
((GridTableElement)this.radGridView1.TableElement).ErrorRowHeaderImage = Image.FromFile("..\\..\\DataSources\\error.png");
((GridTableElement)this.radGridView1.TableElement).NewRowHeaderImage = Image.FromFile("..\\..\\DataSources\\star.png");
Setting an image in a column header
The following code snippet demonstrates how to set an image for a certain column:
Set an image in a column header
C#
radGridView1.Columns["Date"].HeaderImage = Image.FromFile("..\\..\\DataSources\\star.png");
radGridView1.Columns["Date"].TextImageRelation = TextImageRelation.ImageAboveText;