B4A Library Grid/Table and ListView Library

This library allows to create easely grids/tables and
from version 2.50
list views too!
Enjoy!
:)

The original post has been moved
http://www.b4x.com/android/forum/threads/grid-library.16381/page-10#post-168452"

Version 2.50 beta
- Added support for multiline rows

Version 2.51 beta
- Bug fixes

Version 2.52 beta
- Added Typeface support for rows and hedaer

Version 2.53
- Added SingleLine property for columns

sample code and usage hints can be found here
http://www.b4x.com/android/forum/threads/grid-library.16381/page-15#post-194602

Version 2.55
- Added object b4aActivityContext

Version 2.56
- Added and modified event hendlers
https://www.b4x.com/android/forum/threads/grid-and-listview-library.16381/page-19#post-297198

Version 2.57
- Added Columns Builders
https://www.b4x.com/android/forum/threads/grid-and-listview-library.16381/page-19#post-299406

Version 2.58
- Bug fixes

Version 2.59
- Added RowHeight for each column
- Added HeaderHeight for each column
https://www.b4x.com/android/forum/threads/grid-and-listview-library.16381/page-19#post-304465

Version 2.60
- Added TouchX() and TouchY()
- Added FirstVisiblePosition() and LastVisiblePosition()
https://www.b4x.com/android/forum/threads/grid-and-listview-library.16381/page-19#post-304905

Version 2.65
- Added Button Columns
https://www.b4x.com/android/forum/threads/grid-and-listview-library.16381/page-19#post-306507

Version 2.67
- Added CellProps event
- Removed PropSetColor / PropSetTextColor
https://www.b4x.com/android/forum/threads/grid-table-and-listview-library.16381/page-19#post-307490

Version 2.71
- Added OnSelectAllow event
- Added selection on row background
https://www.b4x.com/android/forum/threads/grid-table-and-listview-library.16381/page-21#post-347618

Version 2.73
- Added OnRowProps event
https://www.b4x.com/android/forum/threads/grid-table-and-listview-library.16381/page-21#post-349404

Version 2.76
- Fixed dubug log bug
https://www.b4x.com/android/forum/threads/grid-table-and-listview-library.16381/page-21#post-375965

If you like my grid.
You can support the development.


 

Attachments

  • xnGridSample200beta.zip
    3.6 KB · Views: 2,041
  • xnGrid2xx_1.png
    xnGrid2xx_1.png
    77.2 KB · Views: 5,089
  • xnObjects267.zip
    75.7 KB · Views: 776
  • xnObjects272.zip
    87.2 KB · Views: 581
  • xnObjects273.zip
    87.5 KB · Views: 678
  • xnObjects276.zip
    87.2 KB · Views: 1,413
Last edited:

David Hawkins

Active Member
Licensed User
Longtime User
Hi

No doubt that the code is correct but how do you set a cell back color, because I am having trouble doing this.

Regards

David
 

imgsimonebiliato

Well-Known Member
Licensed User
Longtime User
With the same code that you wrote:

B4X:
If aCol = 1 Then
  If aRow = 1 Then
  aProps.BackGroundColor = Colors.Green
  End if
End if

Maybe you haven't changed the word "gg" with the name of your xnGrid
 

David Hawkins

Active Member
Licensed User
Longtime User
Hi this is the code I am using 'TimeGrid' is the name of my grid

B4X:
Dim props As xnGridCellProps

        TimeGrid_CellProps(2 , 1, "0", props)

    End If
End Sub

Sub TimeGrid_CellProps (aCol As Int , aRow As Int , aValue As String , aProps As xnGridCellProps )
    If aCol = 2 Then
           If aRow = 1 Then
             aProps.BackGroundColor = Colors.Red
           End If
    End If
End Sub
 

stefanobusetto

Active Member
Licensed User
Longtime User
Try this please.

B4X:
Sub <....>_CellProps ( aCol As Int , aRow As Int , aValue As String , aProps As xnGridCellProps )
If aCol = 1 Then
   aProps.BackGroundColor = Colors.Gray
End If

If aCol = 1 Then
   If aRow = 1 Then
      aProps.BackGroundColor = Colors.Green
   End If
End If
End Sub

The prevoius code sets the background color of the column 1 to Gray
and the background color of the column 1 of the row 2 to green
:)
 

David Hawkins

Active Member
Licensed User
Longtime User
Hi Stefano

I got it to work (sort of) as I did not expect the <...>_CellProps to trigger when I clicked on the grid, is that correct?.

I suppose I was looking for something like nameofgrid.cell(row,col).backcolor = colors.red, does that seem like it is something possible to do?

Regards

David
 

TheMightySwe

Active Member
Licensed User
Longtime User
Hi again,

Is it possible to make a row visible but "disabled", so it does not respond to clicks or longclicks and looks slightly different?
 

stefanobusetto

Active Member
Licensed User
Longtime User
There is no such built in feature.
But if you can create a list of disabled rows indexes and use
the On_CellProps event to custom color the row/cell.
And of course use the same list in the On_Click events
to take no action.
:)
 

stefanobusetto

Active Member
Licensed User
Longtime User
Yes several times.
Should i have some requests i'll do it.
Sorting can be easely achieved using the events
already present in the grid.
:)
 

qsrtech

Active Member
Licensed User
Longtime User
Thank you for the great grid. I can't seem to determine how to "hide" a row. Is this possible? If not can you make it possible? ;)
 

aviario

Active Member
Licensed User
Longtime User
Hello stefanobusetto, when we can have this property for the versión 2.67

PropSetHeight property to change the height of the cells

Thank You
 
Top