1. Remove the DataGridView boot column (indicating the column where the arrow is)
Two attributes: Rowheadersvisible = false; Columnheadersvisibele = False
2. Select a row for DataGridView instead of a cell
Set Property SelectionMode to Fullrowselect
3. Set the GridView all columns to populate the parent layout:
Datagridview1.autosizecolumnsmode = Datagridviewautosizecolumnsmode.fill;
4. The setup form is displayed in the middle of the computer screen:
This. StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
5.form Add Key_down event, press no response.
You need to set the value of the KeyPreview property in form to True
6. Prohibit users from changing DataGridView row, column height
DataGridView Properties: Allowusertoresizerows and Allowusertoresizecolumns set to False
7. Hide the DataGridView Cell box:
The Cellborderstyle property is set to None
8. Set a column to display a red font:
The third column is set to red font roomgridview.columns[2]. Defaultcellstyle.forecolor = color.red; 9. Set column header not clickable sort:
for (int i = 0; i < RoomGridView.Columns.Count i++) {//Set header click Sort function Not available Roomgridview.columns[i]. SortMode = datagridviewcolumnsortmode.notsortable; } 10. To set a column cell text to center display:
Set second column cell contents centered
ROOMGRIDVIEW.COLUMNS[1]. Defaultcellstyle.alignment = Datagridviewcontentalignment.middlecenter;
11.c# add an underscore column to use the Datagridviewlinkcolumn column, when manually added, to display the text, add properties: datagridviewlinkcolumn LC = new Datagridviewlinkcolumn ();
Lc. Name = "TEST"; Lc. Text = "Test"; Lc. HeaderText = "Modify"; Lc. Usecolumntextforlinkvalue = true; 12. Modify Row Height:
The Height property under the Rowtemplate property.
13. Set column headings in the middle, sometimes not fully centered, but the left side of the solution:
Deep copy in 14.c#:
The 15.c# ToolTip property is used to implement the mouse hover prompt text effect.
16. Draw Split Line: