haber
  • haber
  • Newbie Topic Starter
2019-10-16T17:40:37Z
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, 😎 = 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
  • haber
  • Newbie Topic Starter
2019-10-17T19:55:38Z
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
2019-10-21T15:29:16Z
Citace:

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


Citace:

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.
Similar Topics
Users browsing this topic