Example E2706
Visible to All Users

Reporting for WinForms - Custom Icons for the Field List Items in the End-User Designer

This example shows how to replace initial images with custom images for the Field List items.

Field List with Custom Icon

Files to Review

Documentation

More Examples

Example Code

CustomFieldListService.cs(vb)
C#
using System.ComponentModel; using DevExpress.Utils; using DevExpress.Utils.Svg; namespace FieldListCustomIcons { class CustomColumnImageProvider : DevExpress.Data.Browsing.Design.ColumnImageProvider { int categoryNameIndex; public override int GetColumnImageIndex(PropertyDescriptor property, DevExpress.Data.Browsing.Design.TypeSpecifics specifics) { if (property.Name.Equals("CategoryName")) return categoryNameIndex; return base.GetColumnImageIndex(property, specifics); } public override SvgImageCollection CreateSvgImageCollection() { SvgImageCollection result = base.CreateSvgImageCollection(); SvgImage image = new SvgImage(typeof(CustomColumnImageProvider), "FieldListCustomIcons.StarIcon.svg"); result.Add(image); categoryNameIndex = result.Count - 1; return result; } } }
Form1.cs(vb)
C#
using System; using System.Windows.Forms; using DevExpress.XtraReports.UI; // ... namespace FieldListCustomIcons { public partial class Form1 : Form { public Form1() { InitializeComponent(); DevExpress.Data.Browsing.Design.ColumnImageProvider.Instance = new CustomColumnImageProvider(); } private void button1_Click(object sender, EventArgs e) { XtraReport1 report = new XtraReport1(); ReportDesignTool designTool = new ReportDesignTool(report); designTool.ShowDesignerDialog(); } } }

Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.