Version

Close(Boolean) Method

Closes the template, if open.
Syntax
'Declaration
 
Public Overloads Function Close( _
   ByVal commitChanges As Boolean _
) As Boolean
public bool Close( 
   bool commitChanges
)

Parameters

commitChanges
True if any changes made should be persisted to the underlying row.

Return Value

True if the template was closed successfully, or was already closed.
Remarks
True if the template was closed successfully, or was already closed.

Note: If the changes cannot be committed, the template will still try to close itself. If you do not want to close the template if the changes cannot be committed, manually call CommitChanges and check the return value before calling this method.

Note: Cancelling the changes will not show on the grid unless the underlying object that the row is bound to implements the IEditableObject interface. If this is not the case, then cancelling change will need to be performed manually.

Example
The following snippet attempts to save the changes made through the template to the underlying row, displaying a MessageBox if the attempt failed or closing the template if successful.

Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
	' Attempt to commit the changes to the underlying row
	If Me.UltraGridRowEditTemplate1.CommitChanges() Then
	' If we the changes were successfully made, close the template
		Me.UltraGridRowEditTemplate1.Close(False)
	Else
		' Notify the user that we couldn't update the changes
		MessageBox.Show("Could not commit changes")
	End If
End Sub
private void btnSave_Click(object sender, EventArgs e)
{
    // Attempt to commit the changes to the underlying row
    if (this.ultraGridRowEditTemplate1.CommitChanges())
        // If we the changes were successfully made, close the template
        this.ultraGridRowEditTemplate1.Close(false);
    else
        // Notify the user that we couldn't update the changes
        MessageBox.Show("Could not commit changes");
}
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