XtraGrid has powerful functions, such as filtering, sorting, Master/Slave tables, and group. Here we only write some usage experiences in the practice process. You can find many usage methods in its own sample.
1.How to display the horizontal scroll bar is not displayed by default. I have been searching for this for a long time.
Set OptionsView. ColumnAutoWidth = false;
2.Display custom text in cells, such as bandingThe value is 1., You want to display one
CustomColumnDisplayText event setting e. DisplayText = "XXX"
3.Set the color of a row
Set e. Appearance. BackColor in the RowStyle event
4.Set the color of a cell
Set e. Appearance. BackColor in the RowCellStyle event
5.Show filter row,Filter rows.
OptionsView. ShowAutoFilterRow = true;
6.A full button is displayed in the cell of a column.
Select ColumnEdit new and ButtonEdit in that column, and set ButtonEdit. Buttons [0]. Caption = "XXX ",
Set ButtonEdit. Buttons [0]. Kind = Glyph. Otherwise, the button is not supported by the cell. (The default Kind is Ellipsis)
Implement the ButtonClick event of ButtonEdit.
7.Set the Master/Slave table.SourceIs dataset,The master-slave table relationship is set in the table, which is supported by default,Resolve binding hereTo adoenitity(Or other entities), the entity set entity is also the relationship between the master and slave tables..
In the MasterRowGetRelationCount event, set e. relationCount = 1; (if two slave tables write 2, and so on), then set e in the MasterRowGetChildList event. childList = a record in the master table corresponds to n records in the slave table. e. childList accepts an IList. e has three parameter rowHandle numbers, the number of the master-slave relationship in relationIndex, and childList sets the value of the record in the row corresponding to the master table in the slave table.