Working example and picture here viewtopic.php?f=15&t=1366
The first column in the grid is intended to be centered, alas remains left-aligned .
1st column justification in the grid
Moderator: Rathinagiri
- Czarny_Pijar
- Posts: 172
- Joined: Thu Mar 18, 2010 11:31 pm
- Location: 19.2341 E 50.2267 N
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: 1st column justification in the grid
Hi CzarnyCzarny_Pijar wrote: The first column in the grid is intended to be centered, alas remains left-aligned .
RegardsHMG Reference wrote:- The leftmost column in a grid control must be left aligned.
--
Esgici
Viva INTERNATIONAL HMG
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: 1st column justification in the grid
As Esgici said, this is clarified in the reference.Czarny_Pijar wrote:Working example and picture here viewtopic.php?f=15&t=1366
The first column in the grid is intended to be centered, alas remains left-aligned .
This is a limitation inherited from Windows ListView control.
The trick to workaround this, is to create a first column with 0 width. So, the first visible column will be the second, that could be aligned as you wish.
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
Re: 1st column justification in the grid
Hi Czarny,Czarny_Pijar wrote:Working example and picture here viewtopic.php?f=15&t=1366
The first column in the grid is intended to be centered, alas remains left-aligned .
Please take a look for the following interesting thread with a small trick:
viewtopic.php?f=5&t=1124#p7836
Hope that helps
Kind Regards,
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
- Czarny_Pijar
- Posts: 172
- Joined: Thu Mar 18, 2010 11:31 pm
- Location: 19.2341 E 50.2267 N
Re: 1st column justification in the grid
Thank you all and sorry for the mess.
Next time before posting I will check at least the earlier posts for the existng solutions.
Next time before posting I will check at least the earlier posts for the existng solutions.
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: 1st column justification in the grid
Thanks for remember us that.gfilatov wrote:Hi Czarny,Czarny_Pijar wrote:Working example and picture here viewtopic.php?f=15&t=1366
The first column in the grid is intended to be centered, alas remains left-aligned .
Please take a look for the following interesting thread with a small trick:
viewtopic.php?f=5&t=1124#p7836
Hope that helps
I'll must test and analyze the code yet to consider its inclusion in HMG.
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: 1st column justification in the grid
I've not tested, but I'm pretty sure that this hack is working fine.gfilatov wrote:Please take a look for the following interesting thread with a small trick:
viewtopic.php?f=5&t=1124#p7836
The hack consist of adding an extra-column, when column zero is not left-aligned and later deleting the original one (the column #0).
Code: Select all
if( iColumn != s )
{
ListView_DeleteColumn( hc, 0 ); // <-- this hack
}
The following quote is from ListView_DeleteColumn macro documentation at msdn(http://msdn.microsoft.com/en-us/library ... S.85).aspx)
Pretty strange... maybe I'm missing something...Column zero of the list-view control cannot be deleted.
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)