需要改变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 = "";

}

}

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐