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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

column type "object"

Thread ID:

Created:

Updated:

Platform:

Replies:

52545 Nov 30,2006 07:53 AM UTC Dec 1,2006 01:50 PM UTC WinForms 3
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On November 30, 2006 07:53 AM UTC

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

Administrator [Syncfusion]
Replied On 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

Administrator [Syncfusion]
Replied On 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

Administrator [Syncfusion]
Replied On 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,

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;