|
jcesar Newbie
Joined: 30 May 2006 Posts: 1
|
Posted: Tue May 30, 2006 9:22 pm
Column Align in Grid |
Hi
How can i set the column align in the grid.
I try this, but don't work.
Code: |
<window name="main" caption="MoneyMax Desktop" width="640" height="480" >
<MEMO name="fldName" align='top'/>
<grid name='DBGrid' align='client'>
<Column align='Right' Caption="UniqueId" />
<Column Caption="Data" Align="right" />
<Column Caption="Histórico" Align="Center" />
<Column Caption="Valor" align='right' />
</grid>
<script>
Dim A()
Set HB = core.CreateObject("HbDao.HB_Recordset","")
HB.OpenTable "c:\palm\jct5\Backup\mmax_tbtransacao.pdb","cheu9nB0nkbobf9iWI1=c5v7sfgAzt03tVilPrZ=jqdKNBvxCz2YEXdXK5WDkJqMJgfXEJr0xJHMUwk95xD5EO"
HB.MoveFirst
fldName.Add HB.Field("Historico")
recCount = HB.RecordCount
ReDim A(4, recCount)
For i = 0 to recCount - 1
A(0, i) = HB.Field("UniqueId")
A(1, i) = HB.Field("Data")
A(2, i) = HB.Field("Historico")
A(3, i) = FormatNumber(HB.Field("Valor"),2)
HB.MoveNext
Next
DBGrid.Data = A
</script>
</window> |
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue May 30, 2006 11:38 pm |
I'm afraid it's a bug in the Grid component that I'm using in zApp. When you have a database assigned to a grid, the alignment of the *field* overrides the alignment of the column. If you have access to the underlying alignment property for the Field object then you might be able to change it there.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed May 31, 2006 5:20 pm |
Actually, I came across some possible solutions for you. First, it looks like it's a bug in zApp and not the Grid component. The Grid in zApp is made to work with the built-in database components, and instead of using them, you are using your own DAO COM object.
First, you should check to see if you can use any of the build-in support for your database. If you can, it might work better. But I'm not sure how to do DAO, so unless you have another format for your database, you might be stuck using COM objects.
In any case, there is another way to change the alignment property of a column in a grid. First, you need to tell zApp what type of "editor" to use for the column. Then, you access the low-level properties of that column. To do this, you also need to give the column a name. Here is the code that I used to make the first column Right-aligned:
Code: |
<Column name='UniqueId' caption='UniqueId' editor='text'>
...
<script>
UniqueId.Properties.Alignment.Horz = "RightJustify"
|
The possible values of the Horz property are: "LeftJustify", "RightJustify", and "Center".
Hope that helps. |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|