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 Type

I need to have each of my cell in the grid to hold an additional property called MyModel. Since we are designing our application in MVC architecture, the MyModel will intract with each of the cell for getting and setting the data. I have used the GridCellModelBase and GridCellRendererBase classes and created a number of models but I have associated the MyModel for each cell through the GridStyleInfoCustomProperties class in my formload.
My question is.
Is there anyway I can create the MyModel directly inside each of my cell models. Also how do I serialize this customeproperty when I serialize the datagrid?

thanks in advance
thanvir

1 Reply

SA Saravanan A Syncfusion Team June 13, 2007 10:11 PM UTC

Hi Thanvir,

1, Is there anyway I can create the MyModel directly inside each of my cell models
>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Please refer to the attached sample in this forum.
http://www.syncfusion.com/support/Forums/message.aspx?&MessageID=39135

It has has two samples. First sample demonstrate a way to apply the CustomProperty to all the cells in the grid through the static constructor of the derived GridStyleInfoCustomProperties class. Second sample demostrate a way to have a custom property which is used by a derived CellModel and CellRenderer to customize the cell.

2, how do I serialize this customeproperty when I serialize the datagrid?
>>>>>>>>>>>>>>>>>>>>>>>>>>>>
The sample refered above will also serialize the custom property automatically when you serialize the grid, since the custom property will get stored on the grid's internal memory itself.

Regards,
Saravanan

Loader.
Live Chat Icon For mobile
Up arrow icon