Image on header row

3 posts, 1 answers
  1. Vidal Enrique
    Vidal Enrique avatar
    2 posts
    Member since:
    Sep 2015

    Posted 09 Sep 2015 Link to this post

    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. Answer
    Dimitar
    Admin
    Dimitar avatar
    1408 posts

    Posted 10 Sep 2015 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Vidal Enrique
    Vidal Enrique avatar
    2 posts
    Member since:
    Sep 2015

    Posted 10 Sep 2015 Link to this post

    Thanks Dimitar,

    Works Perfectly.

     

    Regards

Back to Top