Mar 28, 2012 Replies: 435 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 xnGridSample200beta.zip 3.6 KB · Views: 2,737 xnGrid2xx_1.png 77.2 KB · Views: 5,962 xnObjects267.zip xnObjects267.zip 75.7 KB · Views: 1,498 xnObjects272.zip xnObjects272.zip 87.2 KB · Views: 1,280 xnObjects273.zip xnObjects273.zip 87.5 KB · Views: 1,370 xnObjects276.zip xnObjects276.zip 87.2 KB · Views: 2,171 Last edited: Oct 25, 2015 Click to expand...
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.
G GaryK4 Member Licensed User Longtime User Nov 2, 2017 #421 magi6162 said: Sorry, could you list a list of all the grid events? thanks Click to expand... Hi, I am just in the evaluation process. The current events are select, long_select and CellProps. As I said in my edited message, I got the program to work. GridCreate2(False) was creating a java error. GridCreate works! I'm not sure what the difference is, but I will go with what is working.
magi6162 said: Sorry, could you list a list of all the grid events? thanks Click to expand... Hi, I am just in the evaluation process. The current events are select, long_select and CellProps. As I said in my edited message, I got the program to work. GridCreate2(False) was creating a java error. GridCreate works! I'm not sure what the difference is, but I will go with what is working.
Bladimir Silva Toro Active Member Licensed User Longtime User Nov 6, 2017 #422 I really liked your Grid, I was trying I would like to know how vertical scroll bars are displayed?
stefanobusetto Active Member Licensed User Longtime User Nov 10, 2017 #423 The horizontal and vertical scroll bars are automatically display. You can enable the FastScroll option Code: Grid.FastScroll = True ;
The horizontal and vertical scroll bars are automatically display. You can enable the FastScroll option Code: Grid.FastScroll = True ;
G GaryK4 Member Licensed User Longtime User Dec 9, 2017 #424 I added the following code to the provided sample program. Sub gg_CellProps ( aCol As Int , aRow As Int , aValue As String , aProps As xnGridCellProps ) Log (aCol & " - " & aRow) End Sub There are 3 rows with 4 columns. When I touch a cell, It lists all rows and columns. Not just the one that I selected? Am I doing something wrong?
I added the following code to the provided sample program. Sub gg_CellProps ( aCol As Int , aRow As Int , aValue As String , aProps As xnGridCellProps ) Log (aCol & " - " & aRow) End Sub There are 3 rows with 4 columns. When I touch a cell, It lists all rows and columns. Not just the one that I selected? Am I doing something wrong?
stefanobusetto Active Member Licensed User Longtime User Dec 10, 2017 #425 The CellProps is called every time a cell is painted. You can set the cell properties assigning vaules to the aProps object. The aCol , aRow and aValue are passed to provide information on the painting cell. What do you want to do?
The CellProps is called every time a cell is painted. You can set the cell properties assigning vaules to the aProps object. The aCol , aRow and aValue are passed to provide information on the painting cell. What do you want to do?
G GaryK4 Member Licensed User Longtime User Dec 10, 2017 #426 stefanobusetto said: The CellProps is called every time a cell is painted. You can set the cell properties assigning vaules to the aProps object. The aCol , aRow and aValue are passed to provide information on the painting cell. What do you want to do? Click to expand... I want to long click on a cell and change it value and background color. Basically, a toggle column.
stefanobusetto said: The CellProps is called every time a cell is painted. You can set the cell properties assigning vaules to the aProps object. The aCol , aRow and aValue are passed to provide information on the painting cell. What do you want to do? Click to expand... I want to long click on a cell and change it value and background color. Basically, a toggle column.
stefanobusetto Active Member Licensed User Longtime User Dec 12, 2017 #427 Save the row when the user long click the cell then in the cellprops event if aRow = SavedRow then .... endif
Save the row when the user long click the cell then in the cellprops event if aRow = SavedRow then .... endif
J jrat Member Licensed User Longtime User Apr 26, 2018 #428 how to set the color of a row based on the value of one column?
imgsimonebiliato Well-Known Member Licensed User Longtime User Apr 26, 2018 #429 jrat said: how to set the color of a row based on the value of one column? Click to expand... Hi @jrat you need to implement this method: Code: Dim grid as xnGrid Sub grid_CellProps ( aCol As Int, aRow As Int, aValue As String, aProps As xnGridCellProps ) Dim v As String v = grid.GetValue2 ( aRow, "VALUE" ) If v = "0" Then aProps.BackGroundColor = Colors.Red If v = "1" Then aProps.BackGroundColor = Colors.Green End Sub
jrat said: how to set the color of a row based on the value of one column? Click to expand... Hi @jrat you need to implement this method: Code: Dim grid as xnGrid Sub grid_CellProps ( aCol As Int, aRow As Int, aValue As String, aProps As xnGridCellProps ) Dim v As String v = grid.GetValue2 ( aRow, "VALUE" ) If v = "0" Then aProps.BackGroundColor = Colors.Red If v = "1" Then aProps.BackGroundColor = Colors.Green End Sub
L laguilar Member Licensed User Longtime User Oct 1, 2018 #431 What reason would the grid appear, but not the rows, only the headers? The row count is > 0 when I look at it in the watch window and the call to RowAppend returns a boolean value of true. I noticed that if I move the focus to a EditText box that is on the screen, then the rows become visible. I've tried calling .Invalidate on the parent panel that the grid is inside of, and I've tried calling the GridRepaint, still no affect. Any ideas?
What reason would the grid appear, but not the rows, only the headers? The row count is > 0 when I look at it in the watch window and the call to RowAppend returns a boolean value of true. I noticed that if I move the focus to a EditText box that is on the screen, then the rows become visible. I've tried calling .Invalidate on the parent panel that the grid is inside of, and I've tried calling the GridRepaint, still no affect. Any ideas?
MarkusR Well-Known Member Licensed User Longtime User Oct 1, 2018 #433 laguilar said: What reason would the grid appear, but not the rows, only the headers? The row count is > 0 when I look at it in the watch window and the call to RowAppend returns a boolean value of true. I noticed that if I move the focus to a EditText box that is on the screen, then the rows become visible. I've tried calling .Invalidate on the parent panel that the grid is inside of, and I've tried calling the GridRepaint, still no affect. Any ideas? Click to expand... try to reproduce it in a new project and if the problem is still there export the project from ide and open a new question with attachment.
laguilar said: What reason would the grid appear, but not the rows, only the headers? The row count is > 0 when I look at it in the watch window and the call to RowAppend returns a boolean value of true. I noticed that if I move the focus to a EditText box that is on the screen, then the rows become visible. I've tried calling .Invalidate on the parent panel that the grid is inside of, and I've tried calling the GridRepaint, still no affect. Any ideas? Click to expand... try to reproduce it in a new project and if the problem is still there export the project from ide and open a new question with attachment.
imgsimonebiliato Well-Known Member Licensed User Longtime User Oct 1, 2018 #434 laguilar said: What reason would the grid appear, but not the rows, only the headers? The row count is > 0 when I look at it in the watch window and the call to RowAppend returns a boolean value of true. I noticed that if I move the focus to a EditText box that is on the screen, then the rows become visible. I've tried calling .Invalidate on the parent panel that the grid is inside of, and I've tried calling the GridRepaint, still no affect. Any ideas? Click to expand... Have you called? Code: aGrid.GridCreate
laguilar said: What reason would the grid appear, but not the rows, only the headers? The row count is > 0 when I look at it in the watch window and the call to RowAppend returns a boolean value of true. I noticed that if I move the focus to a EditText box that is on the screen, then the rows become visible. I've tried calling .Invalidate on the parent panel that the grid is inside of, and I've tried calling the GridRepaint, still no affect. Any ideas? Click to expand... Have you called? Code: aGrid.GridCreate
Bladimir Silva Toro Active Member Licensed User Longtime User Jan 12, 2024 #435 Dear colleagues I have been using this library since 2015 in my B4A projects. I need to be able to create a column that is invisible to the user. This is my code to create the column: cc(0).Initialize2 ( "Cod" , "codb" , 50dip , Gravity.CENTER_VERTICAL + Gravity.CENTER_HORIZONTAL) gg.ColAppend ( cc(0) ) I can't make it invisible to the user. I thank you in advance for your valuable collaboration.
Dear colleagues I have been using this library since 2015 in my B4A projects. I need to be able to create a column that is invisible to the user. This is my code to create the column: cc(0).Initialize2 ( "Cod" , "codb" , 50dip , Gravity.CENTER_VERTICAL + Gravity.CENTER_HORIZONTAL) gg.ColAppend ( cc(0) ) I can't make it invisible to the user. I thank you in advance for your valuable collaboration.
aviario Active Member Licensed User Longtime User Jan 16, 2024 #436 cc(0).Initialize2 ( "Cod" , "codb" , 0dip , Gravity.CENTER_VERTICAL + Gravity.CENTER_HORIZONTAL) gg.ColAppend ( cc(0) )
cc(0).Initialize2 ( "Cod" , "codb" , 0dip , Gravity.CENTER_VERTICAL + Gravity.CENTER_HORIZONTAL) gg.ColAppend ( cc(0) )