且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何通过使用后面的代码来加粗数据网格标题

更新时间:2023-10-04 21:41:58

尝试一下.
Try this.
datagrid.HeaderStyle.Font.Bold = true;


如果要基于某种条件在运行时进行操作,则需要实现针对每一行调用的rowdatabound事件.检查行是否为标题,是否为标题,然后根据您的条件将其设置为粗体.
And if you want to do at runtime based on some condition then you need to implement the rowdatabound event which is called for every row. Check whether the row is header and if it is, then based on your condition, make it bold.