I am using a virtual grid and have on column as a custom renderer.
I have followed the "link" sample and currently it displays nicely and hottracks great. However whenever I click on it and try and save my value to e.style.tag, it crashes..
However, when the virtual method calls to get data I can set the value fine and the control reads it fin. It is only when the control trys to set this value..
Note: I am setting an int to the tag.
ADAdministrator Syncfusion Team March 8, 2004 05:16 PM UTC
In a virtual grid, the grid stores no values. So, when you say "save my value to e.style.tag" what do you mean?
The only thing you can do is to set e.Style.Tag equal to something in QueryCellInfo. To do this, you either have to have dynamically created this tag value in QueryCellInfo, or you have to have stored it in some data storage object and retrieve it in QueryCellInfo.
If you are using a storage object to save your tags, then you may need to save e.Style.Tag in SaveCellInfo if your program modified this Tag through some editing process.
Another comment is that if you are using custom objects as Tags, then those object need to implement ICloneable if you want new objects created as you pass these Tags around through the style (as opposed to just a reference to a single object). Another comment is that if you want to be able to copy and paste tag objects, they need to be marked [Serializable] or implement ISerializable.
MBMatthew BrohnMarch 8, 2004 05:55 PM UTC
So in QueryCellInfo(..) I have an object that is given to the style.tag and then my control reads it and draws something custom.
When the control changes it modifies the object at style.tag. At this point all is good..
The problem is now I would expect SaveCellInfo(..) to be called however it isn''t?
And nO iI do not want to pass more information to the control than it needs to do its simple work..
Cheers, and thanks!!
ADAdministrator Syncfusion Team March 8, 2004 08:25 PM UTC
>>When the control changes it modifies the object at style.tag.
Is ''the control'' a custom cell control? If so, when it ''changes the style'', does it mark the currentcell as dirty by setting Grid.CurrentCell.IsModified to true? If not, the the renderer''s OnSaveCell is not called, and the grid does not know anything needs to be saved.