How to Highlight a Row in Gridview in VB.NET
If you are running a GridView array in your Visual Basic VB.NET application, you may wish to highlight a specific row. You can do so by designating it a “SelectedRow.” This a simple command that, inserted into your VB.NET code in the proper spot, will highlight one row and leave the rest of them untouched. You can designate several rows as “SelectedRow”s, highlighting more than one row at a time.
Instructions
-
-
1
Open your GridView code and scroll down to the row you want to highlight.
-
2
Copy and paste the following three lines of VB code before the row you want to highlight. The “Get” will go on the same line as the row code (with a space after “Get”).
<BrowsableAttribute(False)> _
Public Overridable ReadOnly Property SelectedRow As GridViewRow
Get -
-
3
Save the code by hitting "CTRL-S." When you run your VB.NET program, the row in question will be highlighted.
-
1