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

Unbound Field SaveValue call back

Thread ID:

Created:

Updated:

Platform:

Replies:

120705 Oct 6,2015 04:05 PM UTC Oct 7,2015 10:39 AM UTC WinForms 1
loading
Tags: GridGroupingControl
syed wasi ali
Asked On October 6, 2015 04:05 PM UTC

Hi,

We have grid grouping control with Unbound fields with 2 call back functions for QueryValue and SaveValue to handle the editing of cells for unbound fields.
 

this.gridGroupingControl1.TableDescriptor.UnboundFields.Add(fieldDescriptor);

this.gridGroupingControl1.QueryValue += new FieldValueEventHandler(gridGroupingControl1_QueryValue);

this.gridGroupingControl1.SaveValue +=gridGroupingControl1_SaveValue;

 

 

The query :

 

1) The unbound field has a field descriptor of fieldProperty Type - DOUBLE, say with a default value 48.14

2) If the user edit the cell and enters a non double value, eg : string value (say 'abcd') in any cell of that unbound field. How can we make sure that the   invalid value of 'abcd' value is reset back to 48.14 (the previous valid value for that cell) silently in SaveValue call back function i.e   gridGroupingControl1_SaveValue.

 

As of now, the value stays as 'abcd' with an error, but we do not want to show the error and revert the value to the previous valid value. 

 

 

Can you please revert asap as we have a major production issue regarding this.

 

Thanks,

Hari


Solai A L [Syncfusion]
Replied On October 7, 2015 10:39 AM UTC

Hi Syed,

Thank you for your interest in Syncfusion products. 


To avoid the error messages and replace with correct values.

We can avoid the error messages by setting the ShowErrorMessageBox value to false. In the keydown event, we customized the sample to replace the non-numeric values with the default value.


Code :

//Error provider Properties

this.gridGroupingControl1.TableControl.ShowRowHeaderErroricon = false;this.gridGroupingControl1.TableControl.CurrentCell.ShowErrorIcon = false;

this.gridGroupingControl1.TableControl.CurrentCell.ShowErrorMessageBox = false;

this.gridGroupingControl1.TableControl.CurrentCell.ValidationErrorText = string.Empty;

  void gridGroupingControl1_TableControlCurrentCellKeyDown(object sender,GridTableControlKeyEventArgs e)

        {

            double temp = 0;

            if (e.Inner.KeyCode == Keys.Enter && !(double.TryParse(this.gridGroupingControl1.TableModel.CurrentCellRenderer.ControlText.ToString(),outtemp)))

            {

                this.gridGroupingControl1.TableModel.CurrentCellRenderer.ControlText = defaultvalue.ToString();

                this.gridGroupingControl1.Refresh();

            }


        }

Sample :
http://www.syncfusion.com/downloads/support/forum/120705/ze/RefreshUnboundFields-CS1711288028



Thanks & Regards,
AL.Solai.


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

;