ComponentOne True DBGrid for .NET (2.0) Search HelpCentral 

Deleting a Record

True DBGrid's AllowDelete property must be True in order for the user to delete records through the grid. The default value is False.

To delete a record, the user selects the row to be deleted by clicking its record selector, then pressing the DEL key. Only one record can be deleted at a time. The user cannot select multiple records and press the DEL key to delete them all.

In order for the record to be deleted, the grid must have focus so it can receive the DEL key. Clicking the grid's record selector column does not set focus to the grid. However, if you always want the grid to receive focus when the user clicks the record selector column, set focus to the grid in the grid's SelChange event:

·      Visual Basic

Private Sub C1TrueDBGrid1_SelChange(ByVal sender As Object, ByVal e As C1.Win.C1TrueDBGrid.CancelEventArgs) Handles C1TrueDBGrid1.SelChange

    Me.C1TrueDBGrid1.Focus()

End Sub

·      C#

private void C1TrueDBGrid1_SelChange(object sender, C1.Win.C1TrueDBGrid.CancelEventArgs e)

{

    this.C1TrueDBGrid1.Focus();

}

·      Delphi

procedure TWinForm.C1TrueDBGrid1_SelChange(sender: System.Object; e: C1.Win.C1TrueDBGrid.CancelEventArgs);

begin

  Self.C1TrueDBGrid1.Focus;

end;


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.