GridView cell background image

2 posts, 0 answers
  1. Jamie
    Jamie avatar
    4 posts
    Member since:
    Mar 2014

    Posted 21 Mar 2014 Link to this post

    Please could someone let me know if it is possible to have a background image set to a specific cell on every row, but to also have a label/TextBoxCell in that cell too?

    Any examples would be great.
  2. Dess
    Dess avatar
    1561 posts

    Posted 26 Mar 2014 Link to this post

    Hello Jamie,

    Thank you for contacting Telerik Support.

    It is possible to apply an image to a specific cell for each row via the CellFormatting event:
    private void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e)
        if (e.Column.Name == "ProductName")
            e.CellElement.Image = Properties.Resources.refresh;
            e.CellElement.ImageLayout = ImageLayout.Zoom;
            e.CellElement.TextImageRelation = TextImageRelation.Overlay;
            e.CellElement.ResetValue(LightVisualElement.ImageProperty, ValueResetFlags.Local);
            e.CellElement.ResetValue(LightVisualElement.ImageLayoutProperty, ValueResetFlags.Local);
            e.CellElement.ResetValue(LightVisualElement.TextImageRelationProperty, ValueResetFlags.Local);

    Please refer to our Formatting Cells help article about this topic.

    I hope this information helps. Should you have further questions, I would be glad to help.

    Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

  3. DevCraft banner
Back to Top