itionally set the foreBrush and/or backbrush // depending upon some crireria on the cell value // Here, we color anything that begins with a letter higher than 'F' try { //从DataView中取值,"ItemType"为行的名称 string colValue = this.BindingDataView[rowNum]["ItemType"].ToString(); char val = colValue[0]; if( val > 'F' ) //如果首字母大于 'F' { backBrush = new SolidBrush(Color.BlueViolet ); foreBrush = new SolidBrush(Color.White); } } catc页码:[1] [2] [3] [4] [5] 第3页、共5页 |