dbGrid______cxGrid 转换问题,高分请教!急急急急急急急急!!!!!!!

hmzgz81 2003-09-08 02:26:46
dbgrid中的DbGridEx1ColExit和DbGridEx1DrawColumnCell事件要在cxgrid中实现怎么办!
具体的参数怎么对应的! 在线等待!

代码如下:


///////////DbGridEx1ColExit////////////////

procedure TFrmInitialGoods.DbGridEx1ColExit(Sender: TObject);
begin
If DBGridEx1.SelectedField.FieldName = '简写码' then
DBEdit1.Visible := false;
end;
//////////////////////////


/////////////////////////DbGridEx1DrawColumnCell////////////////////////////////
procedure TFrmInitialGoods.DbGridEx1DrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
begin
if (gdFocused in State) then
begin
if Column.FieldName = '简写码' then
begin
DBEdit1.Left := Rect.Left + DBGridEx1.Left + 2;
DBEdit1.Top := Rect.Top + DBGridEx1.top + 2;
DBEdit1.Width := Rect.Right - Rect.Left;
DBEdit1.Height := Rect.Bottom - Rect.Top;
DBEdit1.Visible := True;
DBEdit1.Clear;
DBEdit1.Text := Column.Field.AsString;
if DBEdit1.Enabled then DBEdit1.SetFocus;
end;
end;
inherited;
end;
...全文
76 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
hmzgz81 2003-09-08
  • 打赏
  • 举报
回复
拜求高手指点,等了一下午,居然没人会!怎么会这样~!小弟刚来不久,头一次问问题,怎么会这么惨不忍睹!
hmzgz81 2003-09-08
  • 打赏
  • 举报
回复
高手呢???
hmzgz81 2003-09-08
  • 打赏
  • 举报
回复
我试过了 没用,高手们都泡妞去了! 郁闷ing郁闷ing郁闷ing郁闷ing郁闷ing郁闷ing郁闷ing郁闷ing郁闷ing
dulei115 2003-09-08
  • 打赏
  • 举报
回复
procedure TFrmInitialGoods.cxGrid1DBTableView1FocusedItemChanged(
Sender: TcxCustomGridTableView; APrevFocusedItem,
AFocusedItem: TcxCustomGridTableItem);
begin
If TcxGridDBColumn(APrevFocusedItem).DataBinding.FieldName = '简写码' then
DBEdit1.Visible := false;
end;
/////////////////////////////////////////////////////////////
procedure TFrmInitialGoods.cxGrid1DBTableView1CustomDrawCell(
Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
var
Rec:TRect;
begin
if (gcsSelected = AViewInfo.State ) then
begin
if Sender.Controller.FocusedItem.Caption = '简写码' then
begin
showmessage('');
Rec := AViewInfo.Bounds;
DBEdit1.Left := Rec.Left + cxGrid1.Left + 2;
DBEdit1.Top := Rec.Top + cxGrid1.top + 2;
DBEdit1.Width := Rec.Right - Rec.Left;
DBEdit1.Height := Rec.Bottom - Rec.Top;
DBEdit1.Visible := True;
DBEdit1.Clear;
DBEdit1.Text := Sender.Controller.FocusedItem.EditValue;
if DBEdit1.Enabled then DBEdit1.SetFocus;
end;
end;
inherited;
end;
hmzgz81 2003-09-08
  • 打赏
  • 举报
回复
to:面向money编程

demo上面没有啊~ 怎么看啊!
hmzgz81 2003-09-08
  • 打赏
  • 举报
回复
怎么看啊! 求教!
OO_is_just_P 2003-09-08
  • 打赏
  • 举报
回复
看Demo

5,392

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧