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.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

3253 Mar 10,2003 08:32 PM Mar 11,2003 01:35 AM Windows Forms 1
loading
Tags: GridControl
Trevor Fritz
Asked On March 10, 2003 08:32 PM

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 01:35 AM

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.

CONFIRMATION

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.

;