您的位置:程序门 -> .net技术 ->



为什么用了datagridtablestyle datagrid 选择行的背景颜色不显示。


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


为什么用了datagridtablestyle datagrid 选择行的背景颜色不显示。[已结贴,结贴人:musclecn]
发表于: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);
发表于:2007-12-03 11:36:001楼 得分:20
设置选择行的颜色不是用
selectstyle     -   color
的吗?
发表于:2007-12-03 15:01:462楼 得分:0
我是按照条件设定颜色
发表于:2007-12-03 21:19:223楼 得分:0
已经解决   可惜


快速检索

最新资讯
热门点击