To make the AddNew row the active row when the program runs, use the AllowAddNew property, and the MoveLast and Select methods.
Complete the following steps:
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Me.C1TrueDBGrid1.AllowAddNew = True |
To write code in C#
C# |
Copy Code
|
---|---|
this.c1TrueDBGrid1.AllowAddNew = true; |
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Me.C1TrueDBGrid1.MoveLast() |
To write code in C#
C# |
Copy Code
|
---|---|
this.c1TrueDBGrid.MoveLast(); |
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Me.C1TrueDBGrid1.Row = Me.C1TrueDBGrid1.Row + 1 |
To write code in C#
C# |
Copy Code
|
---|---|
this.c1TrueDBGrid1.Row = this.c1TrueDBGrid1.Row + 1; |
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Me.C1TrueDBGrid1.Select() |
To write code in C#
C# |
Copy Code
|
---|---|
this.c1TrueDBGrid1.Select(); |
When the program runs, the active row is the AddNew row: