Recent

Author Topic: How can i hide some rows in dbgrid?  (Read 1286 times)

majid.ebru

  • Sr. Member
  • ****
  • Posts: 388
How can i hide some rows in dbgrid?
« on: December 31, 2018, 08:27:11 am »
Hi

I have a dbgrid,how can i hide some rows in dbgrid?!

mangakissa

  • Hero Member
  • *****
  • Posts: 907
Re: How can i hide some rows in dbgrid?
« Reply #1 on: December 31, 2018, 08:48:49 am »
use the filter of your dataset.
Lazarus 1.84 (32b) / FPC 3.0.4
Windows 10

dsiders

  • Full Member
  • ***
  • Posts: 208
Re: How can i hide some rows in dbgrid?
« Reply #2 on: December 31, 2018, 01:44:56 pm »
use the filter of your dataset.

Or, if it is SQL-based, by adding a WHERE clause to its SQL select statement.
Lazarus 2.0.2 / FPC 3.0.4 / Windows 8.1 64-bit

majid.ebru

  • Sr. Member
  • ****
  • Posts: 388
Re: How can i hide some rows in dbgrid?
« Reply #3 on: January 01, 2019, 04:55:22 am »
use the filter of your dataset.

How?
Can you explain?

Handoko

  • Hero Member
  • *****
  • Posts: 3042
  • My goal: build my own game engine using Lazarus

Robert.Thompson

  • Jr. Member
  • **
  • Posts: 56
  • "A very bad coder."
    • Google Voice for Canadians
Re: How can i hide some rows in dbgrid?
« Reply #5 on: January 02, 2019, 09:32:01 pm »
Newbie here so, beware.

DBGrid1.Columns[N].Visible:=false;


where N = column number with the first being 0 (zero), I think.

Rob.
Lazarus:  1.8.4  2018-11-17
FPC:   3.0.4 x86_64-linux-gtk2
System:   Kernel: 4.15.0-39-generic x86_64 bits: 64 gcc: 7.3.0 Cinnamon 3.8.9 Linux Mint 19 Tara
              Phoenix v: 11JB.M044.20100622.hkk date: 06/22/2010
Intel Core i5 M 460 (-MT-MCP-) arch: Nehalem rev.5 cache: 3072 KB
NVIDIA GeForce 310M

mangakissa

  • Hero Member
  • *****
  • Posts: 907
Re: How can i hide some rows in dbgrid?
« Reply #6 on: January 03, 2019, 08:11:08 am »
A column  is not a row
Lazarus 1.84 (32b) / FPC 3.0.4
Windows 10

Robert.Thompson

  • Jr. Member
  • **
  • Posts: 56
  • "A very bad coder."
    • Google Voice for Canadians
Re: How can i hide some rows in dbgrid?
« Reply #7 on: January 03, 2019, 06:27:59 pm »
"A column  is not a row"

Yep, my mistake.  :-[
Lazarus:  1.8.4  2018-11-17
FPC:   3.0.4 x86_64-linux-gtk2
System:   Kernel: 4.15.0-39-generic x86_64 bits: 64 gcc: 7.3.0 Cinnamon 3.8.9 Linux Mint 19 Tara
              Phoenix v: 11JB.M044.20100622.hkk date: 06/22/2010
Intel Core i5 M 460 (-MT-MCP-) arch: Nehalem rev.5 cache: 3072 KB
NVIDIA GeForce 310M