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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Adding Images to the first column of DataBoundGrid

Thread ID:





33443 Aug 19,2005 04:05 PM UTC Aug 19,2005 05:07 PM UTC WinForms 2
Tags: GridControl
Eduardo Silva
Asked On August 19, 2005 04:05 PM UTC

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 04:52 PM UTC

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 05:07 PM UTC

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.


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