how can I add an bitmap from Resources to Grid Column

2 posts, 0 answers
  1. Andreas
    Andreas avatar
    6 posts
    Member since:
    Oct 2017

    Posted 20 Aug 2020 Link to this post


    I'd like to add and show an Bitmap from Resources to Grid Column. But it doesn't work.

    Is there any very simple example?

    Gridview.Rows[count - 1].Cells[header].Value = new Bitmap(Resources.test);

  2. Todor Vyagov
    Todor Vyagov avatar
    46 posts

    Posted 20 Aug 2020 Link to this post

    Hi, Andreas,

    To set an image to a cell you can use the CellFormatting event of RadGridView.

    void radGridView1_CellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e)
        if (e.RowIndex == count - 1 && e.ColumnIndex == header)
            e.CellElement.Image = new Bitmap(Resources.test);
            e.CellElement.ResetValue(LightVisualElement.ImageProperty, Telerik.WinControls.ValueResetFlags.Local);

    For more information about formatting cells visit our help article:

    If you have a whole column with images I recommend using an image column:

    Additionally, if you want to set header cells image, refer to the following help article:

    Let me know if I can assist you further.

    Todor Vyagov
    Progress Telerik

    Five days of Blazor, Angular, React, and Xamarin experts live-coding on , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

Back to Top