This article mainly summarizes the property settings of the control and the attachment for your reference. We will share with you some tips on implementing and using functions in the future.
Girdcontrol is a data container. It contains multiple display modes, while gridview is a two-dimensional table view.
Bind Data source:
List <student> List = new list <student> (); List. Add ...... ...... Gridcontrol. datasource = List;// Note that the data source instead of the gridview is bound to gridcontrol. |
The initial status is as follows:
Property settings:
In Visual Studio design, go to "run designer" to open the Property setting window.
1. optionsview
Showgrouppanel = false; // remove "drag a column header…" from the top of the table ......" Showindicator = false; // do not display the blank column showcolumnheaders = false in the leftmost column; // do not display the column title bar columnautowidth = false; // do not set the automatic column width (in this case, the scroll bar may appear below the table or is not full) allowcellmerge = true; // whether to automatically merge cells // set the line color to enableappearanceevenrow = true; // enableappearanceoddrow = true
You can also set the line background color that is alternately changed here, as shown in article 6th.
2. optionsbehavior
Editable = false; // sets that the cell cannot be edited.
3. optionsselection
Enableappearancefocusedcell = false; // you cannot select a cell. (If this parameter is not set, the background color of the clicked cell remains unchanged when the entire row is selected.) enableappearancefocusedrow = false; // do not select multiselect = true; // You can select multiple multiselectmode = cellselect/rowselect; // select multiple rows or multiple cells (select rowselect)
4. optionsmenu
Enablecolumnmenu = false; // disable right-click the menu displayed in the table heading row
5. optionscustomization
// Disable the title row filter allowfilter = false; // disable the title row sorting allowsort = false; // disable the column moving allowcolumnmoving = false; // disable the change of the column width allowcolumnresizing = false;
6. appearences
Selectedrow & focusedrow (the following two items must be set at the same time): Set the background color of the selected row
Backcolor: mediumslateblue // background color
Forecolor: White // foreground color (font color)
Headerpanel: Set the title line color
Backcolor: Black // background color
Forecolor: White // foreground color (font color)
The color of the title line cannot be changed only when the preceding two items are set. You also need to set the lookandfeel of the control.
Select gridcontrol, locate lookandfeel in the property, and expand,
Set style to ultraflat and usedefualtlookandfeel to false.
Oddrow evenrow: Set the color of the odd and even rows.
Enableappearanceevenrow and enableappearanceoddrow are valid.
Row: You don't have to say much about this...
7. Others
Rowheight // Row Height
Columnpanelrowheight // The Row Height of the title row
Focusrectstyle = none; // The dotted box after the click is canceled,
Devexpress gridview attribute settings Z