We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Icons in grid cells

Thread ID:





17515 Aug 10,2004 01:27 PM Aug 10,2004 03:28 PM Windows Forms 1
Tags: GridControl
Bidin Dinesababu
Asked On August 10, 2004 01:27 PM

Hai, We are using a DataBoundGrid to display data. The grid has a Sevirity field which can have values 1,2,3. I am trying for a way to display Icons each representing this Sevirity value instead of 1,2 and 3 or strings like "High", "Medium" and "Low". Is there any way by which I can keep the column values as 1,2 and 3 and display Icons instead of these values getting displayed. Thanks in advance, Bidin

Administrator [Syncfusion]
Replied On August 10, 2004 03:28 PM

Try this. 1) Create an ImageList that holds your icons and set the ImageList as the style.ImageList property for the column. this.gridDataBoundGrid1.Binder.InternalColumns[1].StyleInfo.ImageList = imageList; 2) Then handle PrepareViewStyleInfo, and there move the style.CellValue to the styleImageIndex property and set teh style.Text to "".
private void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
	if(e.ColIndex == 2 && e.RowIndex > 0)
		e.Style.ImageIndex = (int)e.Style.CellValue;
		e.Style.Text = "";


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.