如何通过使用后面的代码来加粗数据网格标题 [英] How to bold the data grid header by using code behind

查看:47
本文介绍了如何通过使用后面的代码来加粗数据网格标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如何使用C#粗体显示datagrid标头.谁能对此有任何想法.

问候,
Basha.

Hi,

How can i bold the datagrid header by using C#. can anyone have any idea about this.

Regards,
Basha.

推荐答案

尝试一下.
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.


这篇关于如何通过使用后面的代码来加粗数据网格标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆