This is a migrated thread and some comments may be shown as answers.

Image on header row

2 Answers 63 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Vidal Enrique
Top achievements
Rank 1
Vidal Enrique asked on 09 Sep 2015, 10:35 PM
Hello, I need help to add an image, the header of a row if it meets a condition.

I want to replace the default image for any other.

Sorry for my bad English.

 Regards

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 10 Sep 2015, 09:24 AM
Hello Vidal,

Thank you for writing.

You can use the ViewCellFormatting event to set the image of the row header cell:
void radGridView1_ViewCellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e)
{
    if (e.CellElement is GridRowHeaderCellElement)
    {
        e.CellElement.Image = img;
    }
    else
    {
        e.CellElement.ResetValue(LightVisualElement.ImageProperty, Telerik.WinControls.ValueResetFlags.Local);
    }
}

More information about the RadGridView styling is available in the following articles:
I hope this helps. Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Vidal Enrique
Top achievements
Rank 1
answered on 10 Sep 2015, 03:57 PM

Thanks Dimitar,

Works Perfectly.

 

Regards‚Äč

Tags
GridView
Asked by
Vidal Enrique
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Vidal Enrique
Top achievements
Rank 1
Share this question
or