带通配符的Delphi dbgrid

带通配符的Delphi dbgrid,delphi,Delphi,我有DBGrid。有时,如果我更改某些单元格值,它会给出一个通配符。你可以在图中看到这一点 我的问题:当这个通配符出现时,它能出现吗?如何禁用它?该*指示dbgrid处于插入模式 如果您不希望此指示器出现,您可以在事件中更改(其图形)。 如果使用此事件,可能需要将dbGrid.DefaultDrawing设置为false 另见: 另一个选项是实现您自己的自定义样式 type TMyStyleWithNoIndicator = class(TCustomStyleServices)

我有DBGrid。有时,如果我更改某些单元格值,它会给出一个通配符。你可以在图中看到这一点


我的问题:当这个通配符出现时,它能出现吗?如何禁用它?

*
指示dbgrid处于插入模式

如果您不希望此指示器出现,您可以在事件中更改(其图形)。
如果使用此事件,可能需要将
dbGrid.DefaultDrawing
设置为false

另见:

另一个选项是实现您自己的自定义样式

type
  TMyStyleWithNoIndicator = class(TCustomStyleServices)
    function GetElementDetails(Detail: TThemedGrid): TThemedElementDetails; override;  
  end;

  function TMyStyleWithNoIndicator.GetElementDetails(Detail: TThemedGrid): TThemedElementDetails; 
  begin
    inherited;
    //prevent drawing of the insert indicator.
    if Detail in [tgIndicatorInsert] then Result.State = Ord(tgCellNormal);
  end;

  procedure TForm1.Form1Create(Sender: TObject);
  begin
    TStyleManager.SetStyle(TMyStyleWithNoIndicator.Create);
  end;

*
指示dbgrid处于插入模式

如果您不希望此指示器出现,您可以在事件中更改(其图形)。
如果使用此事件,可能需要将
dbGrid.DefaultDrawing
设置为false

另见:

另一个选项是实现您自己的自定义样式

type
  TMyStyleWithNoIndicator = class(TCustomStyleServices)
    function GetElementDetails(Detail: TThemedGrid): TThemedElementDetails; override;  
  end;

  function TMyStyleWithNoIndicator.GetElementDetails(Detail: TThemedGrid): TThemedElementDetails; 
  begin
    inherited;
    //prevent drawing of the insert indicator.
    if Detail in [tgIndicatorInsert] then Result.State = Ord(tgCellNormal);
  end;

  procedure TForm1.Form1Create(Sender: TObject);
  begin
    TStyleManager.SetStyle(TMyStyleWithNoIndicator.Create);
  end;

星号(*)表示连接到DBGrid的数据集处于
dsInsert
状态,即它已开始添加记录,但尚未发布记录。顺便说一句,您可以通过在OI中网格的
Options
属性中将
dgIndicator
设置为False来隐藏星号出现的左侧灰色列。该星号(*)指示连接到DBGrid的数据集处于
dsInsert
状态,即它已开始添加记录,但尚未发布记录。顺便说一句,您可以通过在OI中的网格的
Options
属性中将
dgIndicator
设置为False来隐藏显示星号的左侧灰色列。