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.
Unfortunately, activation email could not send to your email. Please try again.

Force commit cells value

Thread ID:

Created:

Updated:

Platform:

Replies:

116449 May 26,2014 12:26 PM Jun 5,2014 06:42 AM WPF 3
loading
Tags: GridControl
Luca Cavicchioli
Asked On May 26, 2014 12:26 PM

I'm using the GridControl to display and modify data, with no data bound.
Suppose I have a row with a textbox and a checkbox, if I write something in the textbox (or I check the checkbox)  and I move away from the edited cell (I change column or row), everything is fine and that value is set as CellValue, but if I stay on that cell after editing (no row/column change) the property CellValue results empty and not with the value typed/checked.
My users wants to:
1) write something in the text box, 
1b) eventually move on the checkbox cell and check the checkbox 
2) press a button outside the grid and use the value that they have set in the grid cells

Now, the last value set will be lost if they do not move away from the edited cell (in the example shown in the picture attached, after pressing the button, the value of the checkbox cell "Attivo" is not set).
Is there a way to achieve this behavior?
Thank you
    Luca

Attachment: SS_b370bb2b.zip

Kanimozhi Bharathi [Syncfusion]
Replied On May 29, 2014 06:07 AM

Hi Luca,

 

Thank you for using Syncfusion Products.

 

We have analyzed your query. You can get the value of the cell while it is in edit mode by using ControlValue of CurrentCell Renderer like in the following code snippet

 

Code Snippet:

void button1_Click(object sender, RoutedEventArgs e)

{

    if (gridControl.CurrentCell.IsEditing)

      {

         var value = gridControl.CurrentCell.Renderer.ControlValue;

      }

    else

      {

         var row = gridControl.CurrentCell.RowIndex;

         var col = gridControl.CurrentCell.ColumnIndex;

         var value = gridControl.Model[row, col].CellValue;

      }

                      

}

 

Please let us know if you need any further assistance.

 

Thanks

Kanimozhi B

Luca Cavicchioli
Replied On May 29, 2014 11:33 AM

Thank you for the answer. It works exactly as expected!
Another question, is it possible to achieve the same behavior with the GridDataControl? (I miss the CurrentCell in GridDataControl)
Thank you, regards
    Luca

Kanimozhi Bharathi [Syncfusion]
Replied On June 5, 2014 06:42 AM

Hi Luca,

 

Apologize for the delay.

 

You can get CurrentCell in GridDataControl from the CurrencyManager of Model like the below code snippet.

 

 

var cell = griddatacontrol.Model.CurrencyManager.CurrentCell

 

Please let us know if you need any further assistance.

 

Thanks

Kanimozhi B


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.

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.

;