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

GGC custom image cell GridStyleInfo.CellValueType changed

Thread ID:





45969 Jul 3,2006 08:06 AM UTC Jul 3,2006 07:07 PM UTC WinForms 1
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 Regards, Wikus


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


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

or the page will be automatically redirected to 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