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,175
  • xnGrid2xx_1.png
    xnGrid2xx_1.png
    77.2 KB · Views: 5,283
  • xnObjects267.zip
    75.7 KB · Views: 917
  • xnObjects272.zip
    87.2 KB · Views: 700
  • xnObjects273.zip
    87.5 KB · Views: 790
  • xnObjects276.zip
    87.2 KB · Views: 1,562
Last edited:

stefanobusetto

Active Member
Licensed User
Longtime User
Hi
If someone is intrested i can share the sources of my grid to allow the creation of the editing version.
Yust in case i'll post the details
 

grifo49

New Member
Licensed User
Longtime User
Column index

Hi Stefano,

I am new to B4A and I am testing your interesting grid library using your sample test program. I am investigating how I can port under Android os an application developed in vbnet for WindowsCe. My question if it could be possible to return not only the row index but also the column index when I click a cell.

Best regards
 

stefanobusetto

Active Member
Licensed User
Longtime User
Hi grifo49,
you can download the new version with the requested feature.
:)
 
Last edited:

Harris

Expert
Licensed User
Longtime User
Hi
If someone is intrested i can share the sources of my grid to allow the creation of the editing version.
Yust in case i'll post the details

Does this mean you are having difficulty implementing grid edits?
My needs would seem basic: select row, present custom views with edit controls (for text), save custom views replacing row with new values (update row flag with EDIT). Repaint row (refresh grid) showing new values.

When done with grid, I shall update database table with rows marked as EDIT. Actually, in my particular case, Editing is not allowed. I must preserve the record (for edit) and create a new record (audit trail). This is easily accomplished since the DBtable contains the original (recID) and the grid contains the edit request.

Note that this does not handle inserts or deletes (for others).

Thanks
 

grifo49

New Member
Licensed User
Longtime User
Thanks

Many thanks Stefano. :sign0098:

It works well and I think that it can be an useful feature also for other people.

As I just started yesterday to play with Android o.s. and b4a I have some question and wishes about your grid:

1) Is it possible to specify some different specs for the text in the cell grid when I create the grid view? ( i.e.: the gray text color in your sample is very light and is unreadable with some row backcolor; i'd like to change it).

2)At the top of my wishes there is the possibility to set the row color of each row by code in order to point out rows belonging to different groups.

3)As pointed out also from other people it can be of interest the choice to select a propriety to draw horizontal and vertical lines to delimit cells

Regards
 

stefanobusetto

Active Member
Licensed User
Longtime User
You have
RowEvenColor/ RowOddColor
SelectedEvenColor / SelectedOddColor
and also
HeaderColor

As for conditional grid coloring, i have an idea on how to implerment
but little time.
I'm working on gird lines at the present time.

:)
 

stefanobusetto

Active Member
Licensed User
Longtime User
@harris
I've developed the grid because i needed it.
I've posted it just in case someone else needed.
I'm glad adding new features based on the requests of other users.
And i've also planned to add the editing support in a short time.
I dont think it's a big deal.
But i don't know when i'll be able to work on it.
I also know very well that if you are developing an app and you have a component missing some features it is not nice to wait for the features to be implemented.
That's why i've decided to share my sources (and give all the support i can do) with someone who wants to develop the editing version.
:)
 

Harris

Expert
Licensed User
Longtime User
no offence my good man,

I know you work hard on this and many other projects. Your effort is truely appreciated by myself and all. I leech off of everthing everyone else does here - with much remorse. I wish I had the knowledge of what you know to help you (and us) out. Like you, not enough time in a day to learn all required...

No pressure on adding editing - you, and hopefully others shall accomplish it when you can (it's just code AND a tremendous amount of thought/discovery/time). Please don't take my occasional comments / suggestions as demands - however they are phrased. I lack tact - a product of growing up in the military (it corrupts otherwise rational personalities).

This Site:
How the hell does Erel do it? I, and many a good man couldn't hold a candle to his dedication (day and night - reply to almost every rational post).

Thanks for everything..
 

stefanobusetto

Active Member
Licensed User
Longtime User
1) Added long_select event
Example:
B4X:
Sub gg_select
' **************************************************************************
' handling the single selection
' **************************************************************************
If gg.IsMultiselect = False Then
   Msgbox ( "value of the first column = " & gg.GetValue ( gg.RowSelected , 0 ) , "row selected = " & gg.RowSelected )
End If
End Sub

Sub gg_long_select
' **************************************************************************
' handling the long single selection
' **************************************************************************
If gg.IsMultiselect = False Then
   Msgbox ( "LONG : value of the first column = " & gg.GetValue ( gg.RowSelected , 0 ) , "row selected = " & gg.RowSelected )
End If
End Sub

2) Added properties for each row
Rows properties override the global ones

The first property implemented is the background color:
Syntax:
SetPropColor ( Row , Color )
Example:
B4X:
gg.SetPropColor ( 2 , Colors.Green ) 
gg.SetPropColor ( 3 , Colors.White ) 
gg.SetPropColor ( 4 , Colors.Red )
 

stefanobusetto

Active Member
Licensed User
Longtime User
i have it in the "to do" list
but i have not found a good way to introduce the feature
i hope to solve the issue soon in the future
stay in touch
 
Top