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

OnSaveChanges

Hi, I am using a user control in my GridDataBoundGrid cells and am using GridTextBoxCellRenderer as the renderer. In the Renderer''s Validating EventHandler, I set CurrentCell.IsModified = true; however, my OnSaveChanges is not getting called!! I saw in one of this forum messages you said I have to do this: m_eGrid.CurrentCell.EndEdit(); m_eGrid.Binder.EndEdit(); This did not make the OnSaveChanges to be called either. What am I missing? Another question, can I access the grid''s binder from the renderer or the model?

1 Reply

AD Administrator Syncfusion Team September 21, 2004 11:39 PM UTC

It is not clear to me what you mean by using a UserControl with a GridTextCellRenderer. If you are trying to embed a UserControl in a grid cell using a derived cell type, then your usercontrol should raise an event when its value changes (whatever that means for your user control). (For example, if you are using a TextBox to hold a value in your user control, and this is the value that represents the value for your user control, then a TextBox.TextChanged event could serve as the user controls''s value changed event.) Then the cellrenderer class would listen for this value changed event of the user control. In the renderer''s handler for this event, you would use code like:
if (!this.NotifyCurrentCellChanging())
	this.Grid.CurrentCell.IsModified = true;
to tell the grid that the cell has changed and set the IsModified property. In this manner, the above code would be hit everytime your usercontrol is modified. If you cannot get this to work, post a sample project showing what you are trying to do.

Loader.
Up arrow icon