Recent

Author Topic: Quick, INCREDIBLY stupid stringgrid, column title question  (Read 3127 times)

jbmckim

  • Full Member
  • ***
  • Posts: 144
Quick, INCREDIBLY stupid stringgrid, column title question
« on: February 18, 2018, 01:24:26 am »
Where/how in the IDE do you edit the column titles for a stringgrid?  I can add and delete just fine but the keystrokes to modify the title (for fixed columns) has eluded both me and my Google skills (apparently the entire known universe does this programmatically).  Call me old fashioned, but I am adverse to having 8 columns, all with the heading "Title."  (Yes I'm probably losing my mind.)

Feel free to mock me - or if your social skills are strong, chuckle quietly to yourself at home.   %)

Thank you.

Handoko

  • Hero Member
  • *****
  • Posts: 5131
  • My goal: build my own game engine using Lazarus
Re: Quick, INCREDIBLY stupid stringgrid, column title question
« Reply #1 on: February 18, 2018, 01:32:44 am »
Select and right click the string grid > Edit StringGrid

jbmckim

  • Full Member
  • ***
  • Posts: 144
Re: Quick, INCREDIBLY stupid stringgrid, column title question
« Reply #2 on: February 18, 2018, 01:42:07 am »
Nope.

Tried that.  Change the column titles on that display yields nothing in the IDE grid or at run time.


taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Quick, INCREDIBLY stupid stringgrid, column title question
« Reply #3 on: February 18, 2018, 02:00:00 am »
stringgrid is a bit of a double player. It has 2 different ways to define columns
1) is the columns property of the grid. You simply press the 3 dots button and add your columns after that you select your colum locate the title property on the object inspector and expand it change the caption property inside.
2) instead of using the columns property you define the row and number count how many fixed rows and columns you have usually I set the fixed columns to 0 and rows to 1right click the grid on the form and select the edit stringgrid menu item you edit the contents of the column looking cells to what ever you need.

Personally I do not bother with the columns property mostly for reasons of comfort I'm already used to the cells way of thinking.
« Last Edit: February 18, 2018, 02:03:18 am by taazz »
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

jbmckim

  • Full Member
  • ***
  • Posts: 144
Re: Quick, INCREDIBLY stupid stringgrid, column title question
« Reply #4 on: February 18, 2018, 02:17:07 am »
Okay taazz, you've helped me before and this is no exception.  Perfect.

Please feel free to laugh yourself into unconsciousness. 

Thanks again.

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Quick, INCREDIBLY stupid stringgrid, column title question
« Reply #5 on: February 18, 2018, 03:47:52 am »
Okay taazz, you've helped me before and this is no exception.  Perfect.

Please feel free to laugh yourself into unconsciousness. 

Thanks again.
Being stuck is not a matter of laugh. we all need a push from time to time sometimes you have people around you that can help some times you do not.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

ArminLinder

  • Sr. Member
  • ****
  • Posts: 314
  • Keep it simple.
Re: Quick, INCREDIBLY stupid stringgrid, column title question
« Reply #6 on: April 06, 2021, 11:09:43 am »
stringgrid is a bit of a double player. It has 2 different ways to define columns
1) is the columns property of the grid. You simply press the 3 dots button and add your columns after that you select your colum locate the title property on the object inspector and expand it change the caption property inside.
2) instead of using the columns property you define the row and number count how many fixed rows and columns you have usually I set the fixed columns to 0 and rows to 1right click the grid on the form and select the edit stringgrid menu item you edit the contents of the column looking cells to what ever you need.

Personally I do not bother with the columns property mostly for reasons of comfort I'm already used to the cells way of thinking.

Thanks, TAZZ, same here, I was struggling a while trying to change an existing StringGrid, until I found your post. Thanks for helping me out, and I too feel like there should have been a more intuitive way to do it.

Your method (1) helped me, method (2) didn't work. I could edit the Stringgrid and change the column headings, but as soon as I left the StringGrid editor (no matter wether I pressed the "Apply" button or not), my changes were not saved back into the stringgrid on the form.

See attachment.

Armin
Lazarus 3.3.2 on Windows 7,10,11, Debian 10.8 "Buster", macOS Catalina, macOS BigSur, VMWare Workstation 15, Raspberry Pi

dseligo

  • Hero Member
  • *****
  • Posts: 1196
Re: Quick, INCREDIBLY stupid stringgrid, column title question
« Reply #7 on: April 06, 2021, 10:01:09 pm »
Your method (1) helped me, method (2) didn't work. I could edit the Stringgrid and change the column headings, but as soon as I left the StringGrid editor (no matter wether I pressed the "Apply" button or not), my changes were not saved back into the stringgrid on the form.

What do you have in 'Columns' property?
If you have something else than '0 items' then you can't use 'Edit StringGrid' menu.

ArminLinder

  • Sr. Member
  • ****
  • Posts: 314
  • Keep it simple.
Re: Quick, INCREDIBLY stupid stringgrid, column title question
« Reply #8 on: April 07, 2021, 06:56:16 am »
The "Stringgrid Editor" (Right Mouse - Edit Stringgrid) opens (see screenshot above) and I can change things, but they are not written back into the Stringgrid control, regardless of whether I press "Apply"! or not before leaving te editor.

The three-dots menu of the column property is a bit clumsy (to get at the columns headings you heed to dig really deep into the properties dialogs), but it works.

Armin.

« Last Edit: April 07, 2021, 07:01:54 am by Nimral »
Lazarus 3.3.2 on Windows 7,10,11, Debian 10.8 "Buster", macOS Catalina, macOS BigSur, VMWare Workstation 15, Raspberry Pi

dseligo

  • Hero Member
  • *****
  • Posts: 1196
Re: Quick, INCREDIBLY stupid stringgrid, column title question
« Reply #9 on: April 07, 2021, 09:00:27 am »
The "Stringgrid Editor" (Right Mouse - Edit Stringgrid) opens (see screenshot above) and I can change things, but they are not written back into the Stringgrid control, regardless of whether I press "Apply"! or not before leaving te editor.
What do you have in 'Columns' property?
If you have something else than '0 items' then you can't use 'Edit StringGrid' menu.

 

TinyPortal © 2005-2018