In this tutorial, you will learn how to select and highlight records that satisfy specified criteria. A group of similar items is generally implemented as a collection in True DBGrid. When manipulating a group of items in True DBGrid, use techniques similar to those described here.
Complete the following steps:
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Me.ComposerTableAdapter.Fill(Me.DsComposer.Composer) |
To write code in C#
C# |
Copy Code
|
---|---|
this.ComposerTableAdapter.Fill(this.DsComposer.Composer); |
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Dim l As Integer For l = 0 To Me.DsComposer.Composer.Rows.Count - 1 If Me.DsComposer.Composer.Rows(l).Item("Country") = "Germany" Then Me.C1TrueDBGrid1.SelectedRows.Add(l) End If Next Me.C1TrueDBGrid1.Refresh() |
To write code in C#
C# |
Copy Code
|
---|---|
int l; for (l = 0 ; l < this.DsComposer.Composer.Rows.Count; l++) { if (this.DsComposer.Composer.Rows[l].["Country"] == "Germany") { this.c1TrueDBGrid1.SelectedRows.Add(l); } } this.c1TrueDBGrid1.Refresh(); |
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Me.C1TrueDBGrid1.SelectedRows.Clear() |
To write code in C#
C# |
Copy Code
|
---|---|
this.c1TrueDBGrid1.SelectedRows.Clear(); |
This concludes this tutorial; you've successfully completed selecting multiple rows using bookmarks.