android gridview 设置字体,Dev Express设置GridView字体大小

本文介绍了如何在DevExpress的GridView控件中调整字体大小,包括表头和行字体。通过设置Appearance属性的HeaderPanel和Row的Font属性可以完成字体大小的更改。同时,展示了focusRowChanged事件的使用,用于在选中行改变时获取选中行的特定列值。
摘要由CSDN通过智能技术生成

需要改变GridView字体大小时,设置font是无效的,只能通过设置RowHeight的属性值来实现:

f94985c8e0a640291a236eb743fb158a.png

Dev gridview 调整字体大小

private void InitControl()

{

//调整表头字体大小

this.gdvFault.Appearance.HeaderPanel.Font = new Font("Tahoma", 18, FontStyle.Regular, GraphicsUnit.Pixel);

//调整行字体大小

this.gdvFault.Appearance.Row.Font = new Font("Tahoma", 18, FontStyle.Regular, GraphicsUnit.Pixel);

}

GridView的focusRowChanged事件(获取选中行的某列值):

private void gdvWIPMain_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)

{

if (e.FocusedRowHandle >= 0)

{

GlobalVariable.gsCurrentLotID = this.gdvWIPMain.GetFocusedRowCellValue("LOT_ID").ToString();

}

else

{

GlobalVariable.gsCurrentLotID = "";

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值