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

Default renderer

I just spent about an hour tracking down a problem that turned out to be a bug in one of our developers'' code, but I was surprised by how the Syncfusion grid handles it. I have a grid control derived from the syncfusion grid. It sets a number of custom cell types which the developers can override if they want. We have a CellType of "Status" but the developer set some cells to "StatusCell". The cells kept converting to "Static" and the text data was being displayed. I was convinced that the problem lay in my derived class and somehow it was overriding the user''s cell type, but after tracing into the drawing code in the grid, I was surprised to find that if the cell type isn''t found, Static cells are used. I''m just curious why this doesn''t throw an exception. I could understand setting the default Style.CellType to "Static", but if the developer specifically specifies a non-existent cell type, to me, that''s and error that ought to throw an exception. Obviously, I don''t know what all the ramifications of that would be, but just from my limited view, that would seem to be the way it should be handled. Is there some reason that''s not the way it works? Pete

2 Replies

AD Administrator Syncfusion Team April 18, 2005 04:01 PM UTC

Hi Pete, sorry about the trouble. You have a good point. We do not throw an exception in that code because of the dynamic nature of the grid. There is a chance that the cell renderer gets initialized at a later point in time, e.g. while the grid is being initialized. An exception within that routine itsself is also tricky because it gets called so often from many different call stacks. Throwing an exception could cause your application to shutdown with an unhandled exception message. But what would make sense is to log the issue at that moment and at a later point either throw an exception or display a warning (e.g. a static cell with red background color and warning text indicating that the cell type is wrong). We''ll research a bit what the best solution is to give feedback about a unresolved celltype name. Thanks for the feedback. Stefan >I just spent about an hour tracking down a problem that turned out to be a bug in one of our developers'' code, but I was surprised by how the Syncfusion grid handles it. > >I have a grid control derived from the syncfusion grid. It sets a number of custom cell types which the developers can override if they want. > >We have a CellType of "Status" but the developer set some cells to "StatusCell". > >The cells kept converting to "Static" and the text data was being displayed. I was convinced that the problem lay in my derived class and somehow it was overriding the user''s cell type, but after tracing into the drawing code in the grid, I was surprised to find that if the cell type isn''t found, Static cells are used. > >I''m just curious why this doesn''t throw an exception. > >I could understand setting the default Style.CellType to "Static", but if the developer specifically specifies a non-existent cell type, to me, that''s and error that ought to throw an exception. Obviously, I don''t know what all the ramifications of that would be, but just from my limited view, that would seem to be the way it should be handled. > >Is there some reason that''s not the way it works? > >Pete


AD Administrator Syncfusion Team April 19, 2005 12:49 AM UTC

Stefan, that makes sense. That code does get hit from all over the place. I figured there was a good reason that might not be handled that way. If you could find a way to produce some sort of notification either via an exception or even debug message, that would be really helpful. Thanks. Pete

Loader.
Live Chat Icon For mobile
Up arrow icon