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

Custom Cell Types In GGC

I've been wrestling with the GGC control for several days now. I'm evaluating your product and was really impressed with the extensibility of its cell types. However, after download every example you have (including those from this forum), I still can't seem to make it work. I have gotten my cell to appear, but I cannot get it to function correctly (in terms of its rerepsentation of data in the model).

Ideally, I'd love to find an example the a) uses the GGC (not the databound grid); b) uses the data binding; c) binds a *custom celltype* to a custom list of business object, say IMyList; d) demonstrates what methods I need to override to properly render and update the model for this custom cell type; e) a GGC that support the "Add New" row and allows me to enter data for my custom cell.

In general, most of your example in this area use the databound grid (instead of the GGC) and most only use cell types for simple data types.

I've seen about 14 flavors of examples, but none that combine custom celltypes that are bound to custom data types. Each example seems to take a different approach to how it maintains the model and renders the component. And the documentation tells me little about wich methods must be overridden to properly render and maintain the model for a custom cell.

For what it's worth, I've gotten somewhat far with this. However, I've run into two stumbling blocks (that I know of). Each cell complains that I must implement IConvertable for my bound column (I'm hoping there's a way around this, since I cannot force my entity objects or lists to implement this interface). Also, when I add a new row, the contents of my custom column for each new row seems to be a shared reference (instead of a new instance of the cell). I say this because the contents of the new cell contain the same data for all cells. If I change one, they all change.

So...I know this is a long-winded post. Ultimately, if you could provide an example of a GGC that had a custom cell type that was a user control with a listbox in it, you'd probably resolve this issue for me. The only caveats would be that the listbox be populated from an IList type and the GGC should allow "add new" rows.

I've invested far too much time in this now and would love to find an answer that allowed me to get this off the ground, but I'm stuck. Any help would be greatly appreaciated.

3 Replies

HA haneefm Syncfusion Team May 29, 2007 09:45 PM UTC

Hi Tod,

One way to do this would be to derive a custom cell type like the ones( \4.4.0.49\windows\Grid.Windows\Samples\CustomCellTypes\SliderCells). It requires a model class and a renderer class. The model class handles the serialization requirements for the control and creates the renderer class. The renderer class handles the UI requirements of the cell. Then to use your custom cell type in a grid, you need to register this celltype with the grid as shown in this sample.s\Syncfusion\Essential Studio\4.4.0.49\windows\Grid.Windows\Samples\CustomCellTypes. Also the attached sample shows you "How to bind custom celltypes in a GroupingGrid?". It also uses the IBindinglist as datasource. Please try the sample and let me know if this helps.

Sample : CustomCellTypeSample

Best regards,
Haneef


TG Tod Golding May 30, 2007 07:12 PM UTC

Thanks for you help. I've made more progress but I still can't get passed the one fundamental problem that landed me here. The list of objects I'm binding two has properties that are my own custom objects. When I edit the cell value for the cells that are bound to these custom types, the grid tells me I must implement ICovertible for the type that's bound to that cell. What do I need to do to prevent this error from occurring. The cell seems to allow me to populate its CellValue, but its throwing this IConvertible error. Should I just turn off valiation for the cell or is there some way to get this to work *without* requiring me to implement IConvertible (which I can't do, since the objects aren't owned by me)?




>Hi Tod,

One way to do this would be to derive a custom cell type like the ones( \4.4.0.49\windows\Grid.Windows\Samples\CustomCellTypes\SliderCells). It requires a model class and a renderer class. The model class handles the serialization requirements for the control and creates the renderer class. The renderer class handles the UI requirements of the cell. Then to use your custom cell type in a grid, you need to register this celltype with the grid as shown in this sample.s\Syncfusion\Essential Studio\4.4.0.49\windows\Grid.Windows\Samples\CustomCellTypes. Also the attached sample shows you "How to bind custom celltypes in a GroupingGrid?". It also uses the IBindinglist as datasource. Please try the sample and let me know if this helps.

Sample : CustomCellTypeSample

Best regards,
Haneef


HA haneefm Syncfusion Team May 30, 2007 11:36 PM UTC

Hi Tod,

Please follow the below forum thread.
http://www.syncfusion.com/support/Forums/message.aspx?&MessageID=56622

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon