Dev gridview custom statistical row cell color, devgridview
Two steps:
1. register the GridView mdrawfootercell event of the GridView.
2. Modify e. Appearance. ForeColor according to the condition in the event response.
Example:
Public FormMMIRPWTEST () {InitializeComponent (); gridView1.CustomDrawFooterCell + = gridView1_CustomDrawFooterCell;} void gridView1_CustomDrawFooterCell (object sender, DevExpress. xtraGrid. views. grid. footerCellCustomDrawEventArgs e) {switch (e. column. name) {case "MemoEdit": // find the corresponding column Name if (e. info. value. toString (). equals ("2") {e. appearance. foreColor = Color. red;} else {e. appearance. foreColor = Color. green;} break; case "gridColumnNum": // find the corresponding column name var val = 0; if (int. tryParse (e. info. value. toString (), out val) & val <100) {e. appearance. foreColor = Color. red;} else {e. appearance. foreColor = Color. yellow;} break; case "MemoEditEx": // find the corresponding column name e. info. value = e. info. summaryItem. tag; // e. info. displayText = "hello DisplayText"; e. appearance. foreColor = Color. yellow; break; default: break ;}}
Effect:
I don't know why e. Appearance. BackColor is set to invalid (instead, it is valid in non-statistical rows). I am sorry to inform you of this.