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

Derived GDBG CellRenderer - ControlValue problem

Thread ID:

Created:

Updated:

Platform:

Replies:

58788 Mar 28,2007 12:21 PM UTC Mar 30,2007 12:19 PM UTC WinForms 5
loading
Tags: GridControl
Marek Solarski
Asked On March 28, 2007 12:21 PM UTC

Hello,

I derived my own GridCellRenderer from GridDropDownCellRenderer.
I'd like it to function similar to ComboBox - with support for saving one value and showing another.

The problem is that, when I type value into the grid's cell (for example 'v2', which is correct and should be save as 2) and press Enter I get
message that "'v2' is not a valid value for Int64".

It seems that Renderer tries to save the ControlText property to DataSource, not the ControlValue, which I'd like to be saved.
(When ControlText can be cast to Int64 everything seems to be right)


Is there any way to save the ControlValue property to DataSource.

Thank you for any help.

Best regards,
Marek S


Marek Solarski
Replied On March 28, 2007 12:25 PM UTC

Unfortunatelly I didn't manage to attach an example - I get some errors in the WebPage when I try to attach anything :(

This is what I get:

Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "Off".

haneefm [Syncfusion]
Replied On March 28, 2007 07:59 PM UTC

Hi Marek,

You would have to derive the GridDropDownCellRenderer and override the OnSaveChanges method to save the ControlValue directly. Please try the below code snippet and let me know if this helps.

public class MyDropDownCellRenderer : GridDropDownCellRenderer
{
protected override bool OnSaveChanges()
{
this.Grid.Model[RowIndex,ColIndex].CellValue = this.CurrentCell.ControlValue;//save the cell value directly.
this.CurrentCell.IsModified = false;
return true;
}
}

Best Regards,
Haneef

Marek Solarski
Replied On March 29, 2007 11:27 AM UTC

Hi Haneef,

I derived
protected override bool OnSaveChanges()
as you said and it didn't help.

The example I wanted to attach can be downloaded from here:
http://www.infokrak.com.pl/download/wa24.zip

Have a look at it please.

Best Regards,
Marek

haneefm [Syncfusion]
Replied On March 29, 2007 09:12 PM UTC

Hi Marek,

Try override the OnValidate method to achieve this. Please try the modified sample and let me know if this helps.

protected override bool OnValidate()
{
return this.OnSaveChanges();
}

Best regards,
Haneef

Marek Solarski
Replied On March 30, 2007 12:19 PM UTC

Hi Haneef,

It works fine now.

Thank you for your help.

Regards,
Marek S

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

;