需要改变GridView字体大小时,设置font是无效的,只能通过设置RowHeight的属性值来实现:
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 = "";
}
}