B4A Library Grid/Table and ListView Library

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
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…