TDBGridEh 隐藏title,隐藏行线,竖线,搜索行的

本文介绍如何在dfm布局文件中隐藏DBGridEh1的标题栏,使用TMemTableEH作为数据源并调整列样式。还涉及DBGrid的搜索面板位置设置和列线显示控制。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

dfm 布局文件中的


去掉dgtitles 设置为false dgindicator 为False 即可隐藏标题栏

datasource中的Dataset 可以使用 TMemTableEH 控件 作为数据源,里面定义好字段与数据
这种的就是写死在程序中不需要连接数据库

列内容 居中显示 
DBGridEh1.ColumnDefValues.Layout :=tlCenter; 

列显示行线的设置不显示设置为False
DBGridEh1.GridLineParams.DataHorzLines :=False;
DBGridEh1.GridLineParams.DataVertLines :=False;

//搜索行显示在DBGridEh1 下面 显示上一行,下一行DBGridEh1.HorzScrollBar.ExtraPanel.Visible 的这个属性
  if DBGridEh1.SearchPanel.Location = splGridTopEh then
  begin
    DBGridEh1.SearchPanel.Location := splHorzScrollBarExtraPanelEh;
    DBGridEh1.HorzScrollBar.ExtraPanel.Visible := True;
    Button6.Caption := 'FilterPanel in the Top (No)';
  end else
  begin
    DBGridEh1.SearchPanel.Location := splGridTopEh;
    DBGridEh1.HorzScrollBar.ExtraPanel.Visible := False;
    Button6.Caption := 'FilterPanel in the Top (Yes)';
  end;

object DBGridEh1: TDBGridEh
  Left = 5
  Top = 29
  Width = 137
  Height = 429
  Align = alLeft
  AutoFitColWidths = True
  Border.Color = clBtnShadow
  Border.EdgeBorders = [ebRight]
  Color = clBtnFace
  ColumnDefValues.Layout = tlCenter
  Ctl3D = True
  DataSource = DataSource1
  DynProps = <>
  Flat = True
  IndicatorOptions = []
  Options = [dgColumnResize, dgRowLines, dgTabs, dgAlwaysShowSelection, dgConfirmDelete, dgCancelOnExit]
  ParentCtl3D = False
  ReadOnly = True
  RowHeight = 2
  RowLines = 2
  TabOrder = 2
  VertScrollBar.SmoothStep = True
  Columns = <
    item
      CellButtons = <>
      DynProps = <>
      EditButtons = <>
      FieldName = 'MenuName'
      Footers = <>
      Width = 149
    end>
  object RowDetailData: TRowDetailPanelControlEh
  end
end


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值