DGV获取当前选中单元格

 if (e.Cell.Column.Key == nameof(DicDrugUnit.DgCnvRate) || e.Cell.Column.Key == nameof(DicDrugUnit.DgUnit))
                {
                    var data = dgvUnitInfo.Grid.ActiveRow.ListObject as DicDrugUnit;
                    if (data == null || data.DgCnvRate == null || data.DgUnit == null)
                    {
                        return;
                    }
                    data.DgCnvResult = $"1{GetDicHisNameByCode(DicTypeCodeDefine.DRUG_UNIT, data.DgUnit)}={data.DgCnvRate}{data.DgBasicUnit}";
                }

 

posted @ 2020-03-09 17:29  博客YS  阅读(144)  评论(0编辑  收藏  举报