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

column type "object"

Hi,

I have a GGC control which is bound to a business object. Everything works fine for native type columns like "string", "int" etc.

But the business object has one property of type "object". The grid shows all values correct. But when I change a cell of this column (type "object"), the cell gets empty after editing. It seems the value can not be stored correctly for type "object". Did I miss something?

Best regards,
Tom

3 Replies

AD Administrator Syncfusion Team November 30, 2006 09:13 AM UTC

Hi Tom,

You can access the GridTextBoxCellRenderer in TableControlCurrentCellMoving event handler and set the value of the current cell to Renderer.TextBox.Text. Here is a code snippet to show this.

public void CovertCellValueToObject()
{
GridCurrentCell cc = this.gridGroupingControl1.TableControl.CurrentCell;
GridTextBoxCellRenderer cr = cc.Renderer as GridTextBoxCellRenderer;
if( cr != null)
{
GridOriginalTextBoxControl t = cr.TextBox as GridOriginalTextBoxControl;
cc.Renderer.ControlValue = (object)t.Text;
cc.ConfirmChanges(true);
}
}

private void gridGroupingControl1_TableControlCurrentCellMoving(object sender, GridTableControlCurrentCellMovingEventArgs e)
{ CovertCellValueToObject(); }

Please refer to the attached sample for implementation.
GGCObjectTypeColumn.zip

Best Regards,
Haneef


AD Administrator Syncfusion Team November 30, 2006 10:14 AM UTC

Hi Haneef,

thanks for your sample this works wonderful. One more question, when I use my own cell renderer (and cell model) for the object column, what method do I have to override to get the same result?

Thanks in advance,

Cheers


AD Administrator Syncfusion Team December 1, 2006 01:50 PM UTC

Hi Tom,

Sorry for the inconvenience caused.

We would like to know about your custom cell control renderer and model. Is it possible for you to upload us a small sample or modify the attached sample to reproduce the issue here? This will help us to analyse the issue further.

Here is a sample that implement the richtext box and combobox celltype.
GGCObjectTypeColumn.zip

Best Regards,
Haneef,

Loader.
Live Chat Icon For mobile
Up arrow icon