The display of tabular data in vb.net is commonly used in DataGridView controls, which are loved by programmers in a rich variety of data table representations.
I am doing a small system in the use of the DataGridView Control part of the properties, these functions are not easily used at the beginning of use to clarify, as the system is nearing the end, now some of the use of the review. Many of the properties of the control are interlinked, reviewing, and trying to make the road look less curved at the back.
First, how to refresh the data inside the DataGridView After the content of the search
Specific implementation:
Once the operation is complete, call Datagridview1.datasource = Data source again.
The theory is simple: to re- bind the data , that is, to check the data table again. (You may have thought about it, but the problem of running efficiency and speed has never been done, but I am sure that it is the only way to do it without optimizing control itself).
Second, cancel automatic selection
Datagridview1.currentcell = Nothing
or datagridview1.clearselection () ' This is a method, without parameters, without assigning a value, directly referencing.
Third, click any cell in the bank to select the entire row
Property SelectionMode = Fullrowselect(entire row selected)
There are other settings:cellselect(select cell [ default ]),fullcolumnselect (select the entire column), Rowheaderselect (selected at the beginning of the line) Columnheaderselect (check the top of the list).
Four, set the table header
Datagridview1.columns("Data table column name"). HeaderText = "Table header column name" ' Column name ' setting
Datagridview1.columns("Data table column name"). width = value ' column widths setting
Vb. NET in DataGridView controls