| 发表于:2007-12-03 11:02:42 楼主 |
为什么datagrid用了datagridtablestyle 设定指定行的字体颜色,而datagrid 选择行的背景颜色不显示。 比如正常拖动datagrid 选择多行 的背景行颜色是蓝色的,现在背景色不能显示了。 代码如下: datagridtablestyle dgtablestyle = new datagridtablestyle(); dgtablestyle.mappingname = dtable.tablename; datagridcoloredtextboxcolumn dbcolumnstyle = new datagridcoloredtextboxcolumn(); dbcolumnstyle.mappingname = eachcol.columnname; dbcolumnstyle.headertext= eachcol.columnname; //设置变色行的条件以及前景和背景色 //eachcol. dbcolumnstyle.setrowscolor(dtable.select("是否隐藏=true"), new solidbrush(color.red), new solidbrush(color.white)); dgtablestyle.gridcolumnstyles.add(dbcolumnstyle); dgtablestyle.rowheadersvisible=true; dgtablestyle.columnheadersvisible=true; dg1.tablestyles.add(dgtablestyle); |
|
|
|
|