The version that you requested is unavailable. We've redirected you to the latest version of the help.
Version

UpdateData Method

Updates (commits) any modified information.
Syntax
'Declaration
 
Public Sub UpdateData() 
public void UpdateData()
Remarks

The UpdateData method updates any modified information in the grid, sending it to the data provider. When the update is complete, any rows that were marked as having modified data will have that mark cleared. The DataChanged property will be set to False.

Normally, the grid handles the updating of data automatically based on the UpdateMode property, so there will be few situations in which you will need to invoke this method. The major exception is when you want to update the data in response to an event that does not cause the grid to lose focus. For example, clicking on a toolbar button. Since toolbars do not typically take focus, the grid will not send any data to the data provider until you invoke the UpdateData method.

Note that if a cell in the grid is currently in edit mode, this method will not commit the changes to that cell. To handle this, you may want to call the PerformAction method and specify the ExitEditMode action. This allows you to attempt to take the cell out of edit mode and check to make sure this process is successful before calling UpdateData.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also