girdview 中字体怎么改变

wangzhenyue 2008-11-14 03:13:31
如题 ..谢谢
...全文
86 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
criedshy 2008-11-14
  • 打赏
  • 举报
回复
[Quote=引用 10 楼 wangzhenyue 的回复:]
那么 是不是头的字体
是里面内容的字体 颜色啊
[/Quote]

protected void base_gvMain_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.ForeColor = System.Drawing.Color.Blue;
}
}
wangzhenyue 2008-11-14
  • 打赏
  • 举报
回复
那么 是不是头的字体
是里面内容的字体 颜色啊
qq497525725 2008-11-14
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 5653325 的回复:]
G1_RowDataBound中

C# code if (e.Row.RowType == DataControlRowType.Header)
{
foreach (TableCell cell in e.Row.Cells)
{
cell.Attributes.Add("style", "FONT-WEIGHT:normal");
}
}



通过这种方式可以来动态改变。这个是改变列头的字体的例子
其它的例子可以参照这个进行扩展。
[/Quote]

UP
Nporsche 2008-11-14
  • 打赏
  • 举报
回复
exampleDataGridview.Font = new Font(....);

Font(IntPtr) Infrastructure. Initializes a new Font using the specified pointer
Font(Font, FontStyle) Initializes a new Font that uses the specified existing Font and FontStyle enumeration.
Font(FontFamily, Single) Initializes a new Font using a specified size.
Font(String, Single) Initializes a new Font using a specified size.
Font(FontFamily, Single, FontStyle) Initializes a new Font using a specified size and style.
Font(FontFamily, Single, GraphicsUnit) Initializes a new Font using a specified size and unit. Sets the style to FontStyle..::.Regular.
Font(String, Single, FontStyle) Initializes a new Font using a specified size and style.
Font(String, Single, GraphicsUnit) Initializes a new Font using a specified size and unit. The style is set to FontStyle..::.Regular.
Font(FontFamily, Single, FontStyle, GraphicsUnit) Initializes a new Font using a specified size, style, and unit.
Font(String, Single, FontStyle, GraphicsUnit) Initializes a new Font using a specified size, style, and unit.
Font(FontFamily, Single, FontStyle, GraphicsUnit, Byte) Initializes a new Font using a specified size, style, unit, and character set.
Font(String, Single, FontStyle, GraphicsUnit, Byte) Initializes a new Font using a specified size, style, unit, and character set.
Font(FontFamily, Single, FontStyle, GraphicsUnit, Byte, Boolean) Initializes a new Font using a specified size, style, unit, and character set.
Font(String, Single, FontStyle, GraphicsUnit, Byte, Boolean) Initializes a new Font using the specified size, style, unit, and character set.
wangzhenyue 2008-11-14
  • 打赏
  • 举报
回复
等等我试试啊
sunshine_anycall 2008-11-14
  • 打赏
  • 举报
回复
楼上的可以
或者在页面上
$(document).ready(function(){$("gridview_id").attr({style:"FONT-WEIGHT:normal"})})

wonture 2008-11-14
  • 打赏
  • 举报
回复
<rowstyle backcolor="LightCyan"
forecolor="DarkBlue"
font-italic="true"/>
wuyq11 2008-11-14
  • 打赏
  • 举报
回复
设置headstyle和rowstyle,通过css改变字体
也可在rowdatabound中
设置e.Row.Cells[i]
踏平扶桑 2008-11-14
  • 打赏
  • 举报
回复
G1_RowDataBound中
    if (e.Row.RowType == DataControlRowType.Header)
{
foreach (TableCell cell in e.Row.Cells)
{
cell.Attributes.Add("style", "FONT-WEIGHT:normal");
}
}


通过这种方式可以来动态改变。这个是改变列头的字体的例子
其它的例子可以参照这个进行扩展。
evjen 2008-11-14
  • 打赏
  • 举报
回复
不是有个自带的设计器吗?
human_2 2008-11-14
  • 打赏
  • 举报
回复
font 不可以吗?

62,051

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧