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

GridDataBoundGrid Image??

Thread ID:

Created:

Updated:

Platform:

Replies:

33087 Aug 12,2005 10:37 AM UTC Aug 12,2005 12:30 PM UTC WinForms 4
loading
Tags: GridControl
Deus
Asked On August 12, 2005 10:37 AM UTC

hej, I am trying to add a Image to my GridDataBoundGrid... I am useing this code : void GridQueryCellInfo(object sender, GridQueryCellInfoEventArgs e) { e.Style.CellType = "PictureBox"; e.Style.CellValue = GetImage("filename.gif"); e.Style.CellValueType = typeof(Image); } I tryed "PictureBox", "ImageCell", "Image", non of em worked... GetImage() returns a Image obj. Can any help me ??? thx!

Deus
Replied On August 12, 2005 10:38 AM UTC

I forgot to tell that, the row has this text = "System.Drawing.Image"... :o)

Administrator [Syncfusion]
Replied On August 12, 2005 11:32 AM UTC

Just try these two properties (don''t set the CellValueType) using "Image" as the celltype. e.Style.CellType = "Image"; e.Style.CellValue = GetImage("filename.gif"); And things will work much better (faster) if you cache GetImage("filename.gif"); in a form variable and just use that variable in QueryCellInfo.

Deus
Replied On August 12, 2005 11:43 AM UTC

Dident help :s When I fill the Grid I use a DataTable: DataTable dt = new DataTable("Table"); dt.Columns.Add("Image", Type.GetType("System.Int32")); And I set it to 0...

Administrator [Syncfusion]
Replied On August 12, 2005 12:30 PM UTC

If you have a column in your database where you want to see an Int32 value used in the cell, and you also want to see an image in teh cell, then you have to: 1) Add the images you want to use to an ImageList object. 2) Set teh CellType on the column to "Static" or leave it unset so it defaults to "TextBox". 3) In QueryCellInfo for cells in this column, set e.Style.ImageList = yourImageListObject; e.Style.ImageIndex = someIntValueThatIsTheIndexOfTheImageInYourImageList; Here is a little sample. http://www.syncfusion.com/Support/user/uploads/GDBG_Images_79f698b0.zip

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.

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

;