Recent

Author Topic: TRxDBGrid custom drawn  (Read 1303 times)

lainz

  • Hero Member
  • *****
  • Posts: 3849
TRxDBGrid custom drawn
« on: August 18, 2021, 03:40:47 pm »
Hi, I want to make a TRXDBGrid looks like the attached image.

Basically it has:
- A search icon at the left (I can add this as a separate control so no problem)
- Odd and even rows
- No lines between columns
- No lines between rows
- Item height: font height * 2
- Focused row: with custom drawing

Nice to have:
- Row editing working as well

I have all the code to do the drawing, in the screenshot that's a custom listbox. But I need a custom TRXDBGRID because I don't want to change the logic of my program just the UI.

Any ideas? Sample code? Screenshots?

Fred vS

  • Hero Member
  • *****
  • Posts: 2421
    • StrumPract is the musicians best friend
Re: TRxDBGrid custom drawn
« Reply #1 on: August 18, 2021, 04:49:30 pm »
Hi, I want to make a TRXDBGrid looks like the attached image.

Basically it has:
- A search icon at the left (I can add this as a separate control so no problem)
- Odd and even rows
- No lines between columns
- No lines between rows
- Item height: font height * 2
- Focused row: with custom drawing

Nice to have:
- Row editing working as well

I have all the code to do the drawing, in the screenshot that's a custom listbox. But I need a custom TRXDBGRID because I don't want to change the logic of my program just the UI.

Any ideas? Sample code? Screenshots?

What widgetset do you want to use?
With msegui it can be done very easy using TDBstringgrid or TDBWidgetgrid.

Fre;D
« Last Edit: August 18, 2021, 05:14:07 pm by Fred vS »
I use Lazarus 2.0.6 32/64 and FPC 3.2.0 32/64 on Debian 10.2 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64 and Mac OS X Snow Leopard 32.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt, Carbon.

https://github.com/fredvs
https://gitlab.com/fredvs

lainz

  • Hero Member
  • *****
  • Posts: 3849
Re: TRxDBGrid custom drawn
« Reply #2 on: August 18, 2021, 05:58:27 pm »
Hi Fred, how are you doing?

Basically I'm using the LCL, the screenshot is an app made with LCL as well. In the same app I have grids and listbox. With Listbox there's no problem. The thing is with grids.

I've done some styling with the properties, still not 100% what I want...

Fred vS

  • Hero Member
  • *****
  • Posts: 2421
    • StrumPract is the musicians best friend
Re: TRxDBGrid custom drawn
« Reply #3 on: August 18, 2021, 06:40:16 pm »
Hello Leandro.

I am fine and you?

In case if you cannot do what you want with LCL, here fast-done demo using msegui and Zeos DB components.
You will need last commit of mseide-msegui to use the Zeos components.

Fre;D
I use Lazarus 2.0.6 32/64 and FPC 3.2.0 32/64 on Debian 10.2 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64 and Mac OS X Snow Leopard 32.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt, Carbon.

https://github.com/fredvs
https://gitlab.com/fredvs

 

TinyPortal © 2005-2018