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.
Syncfusion Feedback

GGC custom image cell GridStyleInfo.CellValueType changed

Thread ID:

Created:

Updated:

Platform:

Replies:

45969 Jul 3,2006 08:06 AM UTC Jul 3,2006 07:07 PM UTC Windows Forms 1
loading
Tags: Grouping
Wikus Coetser
Asked On July 3, 2006 08:06 AM UTC

On the grid grouping control, I have implemented a custom cell type for displaying images; with an ellipsis button the user can click on to load an image (see attached code). When the application runs, and no related grids are present, the image cell works, but when the image cell is on a related grid, clicking the ellipsis button has no effect. Stepping through the code of the ElipsisButton class (inheriting from the GridCellButton class), on the OnClicked event, and retrieving the affected cell with the GridCellEventArgs arguments passed to the event, the CellValueType of the cell have somehow changed from typeof(byte[]) to null. When inserting a breakpoint on the OnDraw event in the PictureEditBoxCellRender class (inheriting from GridStaticCellRenderer), the GridStyleInfo.CellValueType perameter still returns typeof(byte[]). I assume that when the CellValueType remains typeof(byte[]), I can assign image data to the cell. How could I prevent the CellValueType from changing? (or change it back) I am using Essential Studio 3.3.0.0. Regards, Wikus

image_cells.cs.zip

Administrator [Syncfusion]
Replied On July 3, 2006 07:07 PM UTC

Hi Wikus, To prevent the changing cellvaluetype in a cell, you need to handle the grid''s QueryCellInfo event. Here is a code snippet. private void gridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e) { if( e.Style.CellType == "ImageEllipse" ) { object obj = e.Style.CellValue; if ( !(obj is Byte[]) ) { e.Style.CellValueType = typeof(Byte[]); e.Handled = true; } } } Here is a sample. http://www.syncfusion.com/Support/user/uploads/GroupingImgaeEllipseCell_20b42bf6.zip Let me know if this helps. Best Regards, Haneef

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

;