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

Custom cell rendering

I'm new to the Syncfusion grid, and I'm just kind of finding my way around. Basically, here's what I'm doing. I'm going to create a virtual grid (I need it to be "infinite" horizontally, as the columns are dates). I'll also be merging cells horizontally, as a single cell may need to encompass a range of dates. Now, I need to override the rendering of the cells as well. Preferably, to work well with my existing software, I could pass in a data oriented object, and from that, my custom cell would render itself (a combination of graphics and text). Now, if my understanding is correct, I need to derive a class from GridGenericControlCellRenderer for handling the rendering, and another class from GridGenericControlCellModel to handle the data side. Is this correct? Just want to make sure I'm heading in the right direction before I get too deep into this.

2 Replies

AD Administrator Syncfusion Team May 9, 2003 04:07 PM

Hi Pete, if its just a combination of graphics and text you can just derive from GridStaticCellRenderer. GridGenericControlCellRenderer is a new cell type in our 1.6 release that itsself is derived from GridStaticCellRenderer. It is usefull if you need support for embedding any custom .NET control inside a cell (as shown in SliderCells sample where we set style.Control = editSlider or drawSlider). But if you just draw the content yourself, overriding GridStaticCellRenderers OnDraw method should be enough. See also the sample Grid\Samples\In Depth\DerivedCellControlTutorial. Stefan


PD Pete Davis May 9, 2003 04:45 PM

Stefan, Thanks for making the distinction. Actually, GridGenericControlCellRenderer is more appropriate. After additional thought, I decided to create a control to render the cell in. Glad to understand the distinction, though. Pete > Hi Pete, > > if its just a combination of graphics and text you can just derive from GridStaticCellRenderer. > > GridGenericControlCellRenderer is a new cell type in our 1.6 release that itsself is derived from GridStaticCellRenderer. It is usefull if you need support for embedding any custom .NET control inside a cell (as shown in SliderCells sample where we set style.Control = editSlider or drawSlider). > > But if you just draw the content yourself, overriding GridStaticCellRenderers OnDraw method should be enough. See also the sample Grid\Samples\In Depth\DerivedCellControlTutorial. > > Stefan > >

Loader.
Live Chat Icon For mobile
Up arrow icon