Product Bundles
DevCraft
All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:
Web
Mobile
Document Management
Desktop
Reporting
Testing & Mocking
CMS
UI/UX Tools
Debugging
Free Tools
Support and Learning
Productivity and Design Tools
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);
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); } else { e.CellElement.ResetValue(LightVisualElement.ImageProperty, Telerik.WinControls.ValueResetFlags.Local); } }
For more information about formatting cells visit our help article: https://docs.telerik.com/devtools/winforms/controls/gridview/cells/formatting-cells
If you have a whole column with images I recommend using an image column: https://docs.telerik.com/devtools/winforms/controls/gridview/columns/column-types/gridviewimagecolumn
Additionally, if you want to set header cells image, refer to the following help article: https://docs.telerik.com/devtools/winforms/controls/gridview/styling-and-appearance/images
Let me know if I can assist you further.
Regards, Todor Vyagov Progress Telerik
Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).