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.

Save content of gridControl1

Thread ID:

Created:

Updated:

Platform:

Replies:

90247 Sep 23,2009 06:19 AM Sep 24,2009 05:45 AM Windows Forms 6
loading
Tags: Tools
Allon
Asked On September 23, 2009 06:19 AM

Hello, everyone

I have to check content of gridControl1, before I'm saving it. If I do Label1.Focus() so everything works well. In the second time it shows the value after the first check and before the second one.

For example,

Original value of gridControl1(5, 5).CellValue is 1000

First check:
gridControl1(5, 5).CellValue = 1
Label1.Focus()
Messagebox.Show("Output - " + gridControl1(5, 5).CellValue) 'Output - 1

gridControl1(5, 5).CellValue = 2
Label1.Focus()
Messagebox.Show("Output - " + gridControl1(5, 5).CellValue) 'Output - 1

The output remains "Output - 1" instead of "Output - 2
"


It makes the same results with Text property (gridControl1(2, 2).Text = 1....)

Regards, and thanks in advance :)
Allon

Allon
Replied On September 23, 2009 06:25 AM

P.S

Everything works fine, just if I click another cell and then make the checking.

Regards,
Allon

Rajadurai C [Syncfusion]
Replied On September 24, 2009 12:45 AM

Hi Allon,

Thanks for your interest in Syncfusion Products.

From the code provided, it seems you were trying to change the cellvalue to 1 and then 2. I have created a sample handling this code snippet in a button1_Click() event. It works as expected. Here it was attached for your reference.
http://files.syncfusion.com/support/samples/Grid.Windows/7.3.0.20/F90247.zip

If it seems i misunderstood your requirement, please let me clear by modifying this sample implementing the requirement or issue and update.

Regards,
Rajadurai

Allon
Replied On September 24, 2009 01:54 AM

Rajadurai, Thanks for the little app you sent me.

I had to send a more specific example to demonstrate the problem.
The problem occurred when using a mouse and a keyboard.

The updated example:

Original value of gridControl1(5, 5).CellValue is 1000.

First check:
I click gridControl1(5, 5) with the mouse, and press "1" with the keyboard.

Messagebox.Show("Output - " + gridControl1(5, 5).CellValue) 'Output - 1

(This what should be, and everything's fine...)

Second check (the app is still running):
I click gridControl1(5, 5) with the mouse, and press "2" with the keyboard.

Messagebox.Show("Output - " + gridControl1(5, 5).CellValue) 'Output - 1

(The output remains "Output - 1" instead of "Output - 2)

My question is if I need to use an event similiar to gridControl1.CellValueChanged to change the CellValue property of this cell, and if not, how can I know the current
CellValue or Text, without click another cell of gridControl1 or any other control
in the app.

It made me :) to receive app example, and I hope you'll continue to send me examples, until we fix this problem.

Regards, and have a nice day :)
Allon


P.S

The same problem occurred with Text property.

Rajadurai C [Syncfusion]
Replied On September 24, 2009 02:28 AM

Hi Allon,

Thanks for your details.

While the cell is in editing mode, the changes made after start editing that cell and before leaving that cannot get saved in GridData. Once the editing is complete, the changed cellvalue get updated in it. It is a general behavior followed with gridcells. If you would like to reflect the change made in the cell immediately without leaving that cell, you can call ConfirmChanges() method. Here is the code handled in CurrentCellChanged event for your reference.

Me.gridControl1.CurrentCell.ConfirmChanges()
MessageBox.Show("Output - " & gridControl1(5, 5).CellValue.ToString())

Sample:
http://files.syncfusion.com/support/samples/Grid.Windows/7.3.0.20/F90247a.zip

Regards,
Rajadurai

Allon
Replied On September 24, 2009 03:40 AM

Rajadurai, It works perfect now.

Thanks for the help and explanations.

Have a nice day :)
Allon

Rajadurai C [Syncfusion]
Replied On September 24, 2009 05:45 AM

Hi Allon,

Thanks for your update.

Thankyou for using Syncfusion Products.

Regards,
Rajadurai

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.

;