Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
haber  
#1 Posted : Wednesday, October 16, 2019 6:40:37 PM(UTC)
haber

Rank: Newbie

Groups: Registered
Joined: 10/16/2019(UTC)
Posts: 2
Location: munich

I haven't been using iGrid quite for a while, When I started again using it there is a little problem where I stack:
Hopefully some one will be able to help?


Using iGrid V7.0.15 with VBA
I am not able to place one or more Tabs in the GoupRow
'how would I be able to place a Tab between the CellValue and the following " Total: 1.234"
'to avoid the different Textlength of the Items and make sure that all sum-Amounts are ALIGNED (&H80 will show up as text)


Private Sub CommandButton1_Click() 'CB1_Arr2List
Dim iCol As Long
Dim iRow As Long

With iGrid1
.BeginUpdate

' Create column set
For iCol = START_COL To END_COL
.AddCol sHeader:=DataArray(DATA_START_ROW - 1, iCol) '.Value
Next

.ColWidth(1) = 70 'Cat
.ColWidth(2) = 90 'Sub
.ColWidth(3) = 40 'Bank
.ColWidth(4) = 70 'DateB
.ColWidth(5) = 70 'dateV
.ColWidth(6) = 435 'Reason
.ColWidth(7) = 60 'Amount
.ColWidth(8) = 60 'EUR/$
.ColWidth(9) = 60 'Notes


' Add data from the DataArray
iRow = DATA_START_ROW
'Do While DataArray(iRow, START_COL) <> Empty
Do While iRow <= UBound(DataArray)
.AddRow
For iCol = START_COL To END_COL
.CellValue(.RowCount, iCol - START_COL + 1) = DataArray(iRow, iCol)
Next
iRow = iRow + 1
Loop

Dim i As Long
For i = 1 To iGrid1.RowCount
.CellAlignH(i, 7) = igAlignHRight
.CellAlignH(i, 3) = igAlignHCenter
.CellAlignH(i, 8) = igAlignHCenter
Next
.AggrFuncs.Clear
.AggrFuncs.AddItem 7, igAggrFuncSum


.GroupObject.Clear
.GroupObject.AddItem 1, igSortAsc, igSortByCellTextNoCase
.GroupObject.AddItem 2, igSortAsc, igSortByCellTextNoCase

.DefaultAutoGroupRowExpanded = False
.PrefixGroupValues = False
.Sort 4 'sort date in Sub
.Group

.EndUpdate
End With
End Sub

Private Sub iGrid1_AfterAutoGroupRowCreated(ByVal lRow As Long, _
ByVal lItemCount As Long, ByVal vAggrFuncValues As Variant)
iGrid1.CellTextFlags(lRow, iGrid1.RowTextCol) = igTextExpandTabs
iGrid1.CellTextFlags(lRow, iGrid1.RowTextCol) = igTextTabStop

iGrid1.CellValue(lRow, iGrid1.RowTextCol) = iGrid1.CellValue(lRow, iGrid1.RowTextCol) & _
" Total: " & Format(vAggrFuncValues(1), "#,##0")

'how would I be able to place a Tab between the CellValue and the following " Total...."
'to make sure that all sum-Amounts are ALIGNED (&H80 will show up as text), using vBTab will be ignored

End Sub

Thank's for Attention and Help
Regards Thomas
haber  
#2 Posted : Thursday, October 17, 2019 8:55:38 PM(UTC)
haber

Rank: Newbie

Groups: Registered
Joined: 10/16/2019(UTC)
Posts: 2
Location: munich

When I was trying to swear to the GroupRow to aligned the output of the Sum values, I found an interesting side effect:
When I used the iGrid1.CellAlignH(lRow, iGrid1.RowTextCol) = igAlignHRight command, the output is "shifting to the right each time I'm calling the whole Sub! no matter if I use the iGrid.clear statement on the very beginning. So that means at least that iGrid is remembering something even after a .clear statement!?
Anyone (may be Igor) will be able to help???
Regards Thomas
Igor/10Tec  
#3 Posted : Monday, October 21, 2019 4:29:16 PM(UTC)
Igor/10Tec

Rank: Administration

Groups: Administrators, Forum Moderator
Joined: 1/17/2011(UTC)
Posts: 1,101

Thanks: 15 times
Was thanked: 141 time(s) in 141 post(s)
Quote:
how would I be able to place a Tab between the CellValue and the following " Total...."

The igTextExpandTabs and igTextTabStop flags must be combined with the Or operator when you assign them to the CellTextFlags property. Here is an example of the flag combination to set the number of characters per tab to ten:

igTextExpandTabs Or igTextTabStop Or &HA00


Quote:
When I used the iGrid1.CellAlignH(lRow, iGrid1.RowTextCol) = igAlignHRight command, the output is "shifting to the right each time I'm calling the whole Sub! no matter if I use the iGrid.clear statement on the very beginning. So that means at least that iGrid is remembering something even after a .clear statement!?

If I understood the problem properly without seeing the whole source code, the problem is that the Clear method removes only normal columns but the row text column can't be deleted and it remains in iGrid with all the settings you applied to it.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.