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. Image for the cookie policy date
close icon

GGC custom image cell GridStyleInfo.CellValueType changed

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

1 Reply

AD Administrator Syncfusion Team 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

Loader.
Live Chat Icon For mobile
Up arrow icon