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.

Adding Images to the first column of DataBoundGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

33443 Aug 19,2005 12:05 PM Aug 19,2005 01:07 PM Windows Forms 2
loading
Tags: GridControl
Eduardo Silva
Asked On August 19, 2005 12:05 PM

I''m using a DataBoundGrid linked to a dataset that has 3 queries on a Hierarchy way... I want to add Icons (windows explorer style) to the first column, is it possible? by using the techniques described on some parts of the forum I get the image to appear on the left hand side of the cell but I need it on the left hand side of the text, the gryd seems to be leaving enough space for the image, but drwaing it in the wrong place. My code is (on the PrepareViewStyleInfo event): if(e.RowIndex == 0 ) { e.Style.CellType = "Static"; e.Style.CellAppearance = GridCellAppearance.Raised; if(e.ColIndex == 1) { e.Style.ImageList = imageTree; e.Style.ImageIndex = 0; } }

Eduardo Silva
Replied On August 19, 2005 12:52 PM

I''ve discovered (well this is only a theory) that because my cells are of type DataBoundTreeCell, the ImageList and ImageIndex properites are not valid... any ideas? I''ve tried removing the code before and adding this instead: GridHierarchyLevel level0 = this.dbgTree.Binder.RootHierarchyLevel; level0.InternalColumns[0].StyleInfo.ImageList = imageMenu; level0.InternalColumns[0].StyleInfo.ImageIndex = 0; still no luck

Administrator [Syncfusion]
Replied On August 19, 2005 01:07 PM

If you want them to be seen in addition to the +/- and treelines, then you will likely have to derive your own celltype to manage this. If you have the source code, you can take our code in \Src\Extensions\DataBound\GridDataBoundTreeCell.cs, and tweak it to draw the extra bitmap.

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.

;