/// <summary> /// 绑定符号维护面板 /// </summary> /// <param name="dr"></param> private void BindSymbolDetail(DataRowView dr) { if (dr == null) { return; } RTFHelper rtfhelper = new RTFHelper(); this.txtID.Text = dr["ID"].ToString(); try { this.txtRTF.Rtf = rtfhelper.GetRTFByStr(dr["RTFstr"].ToString()); } catch { this.txtRTF.Text = rtfhelper.GetStrBYRTF(dr["RTFstr"].ToString()); } this.txtMemo.Text = dr["Memo"].ToString(); this.txtLength.Text = dr["Length"].ToString(); }
private void gridViewSymbol_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e) { if (e.RowHandle <= -1) { return; } if (e.Column.FieldName != "RTF") { return; } RTFHelper rtfhelper = new RTFHelper(); DataRow dr = gridViewSymbol.GetDataRow(e.RowHandle); string rtf = rtfhelper.GetRTFByStr(dr["RTF"].ToString()); Image img = EmrSymbolEngine.PrintRTFImage(rtf, e.Bounds.Size); e.Graphics.FillRectangle(Brushes.White, e.Bounds); if (img != null) { e.Graphics.DrawImage(img, e.Bounds.Location); } e.Handled = true; }