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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Displaying icons based on a value in a particular row...

Thread ID:





3253 Mar 11,2003 01:32 AM UTC Mar 11,2003 06:35 AM UTC WinForms 1
Tags: GridControl
Trevor Fritz
Asked On March 11, 2003 01:32 AM UTC

I want to diplay an icon next to a value in a GridDataBoundGrid control much like you see in the windows Event Viewer. Like the windows event viewer i need to have multiple columns of data and the first column will display 1 of 3 icons based on the type of row it is... if it's an error then display a red x, if it's informational display the information icon, etc. i've noticed that the MultipleView and GridListControl samples provide this functionality, but there is no equivelant for a GridDataBoundGrid control. what would be the best strategy for accomplishing this? keeping in mind that the grid could hold 5,000 rows so how it handles it in memory is crucial.

Administrator [Syncfusion]
Replied On March 11, 2003 06:35 AM UTC

Add an ImageList to your project holding the three icons. Then handle the PrepareViewStyleInfo event. In that event, if e.RowIndex > 0 and e.ColIndex is 1 (the col where you want the icon), then set e.Style.ImageList to be your imagelist, and e.Style.ImageIndex to be the index of the icon you want to use for the given row, e.RowIndex. If you need to test values from columns other than e.ColIndex, you can get them by using indexers on the GridDataBoundGrid. If you need to know the value of the e.ColIndex cell, then get it from the e.Style.CellValue.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon