B4A Library Grid/Table and ListView Library

aviario

Active Member
Licensed User
Longtime User
Stefanobusetto Hello, I installed the latest version 2.50, and I encounter the following problem, as you can see in the two images that attached on the right side of the grid with 2.50 do not fit the vertical line

Code
If Cgrid.IsInitialized = False Then
Cgrid.Initialize("Cgrid")

Cgrid.RowHeight = 30dip
Cgrid.HeaderColor = Colors.Gray
Cgrid.RowEvenColor = Colors.White
Cgrid.RowOddColor = Colors.RGB(192,255,192)
Cgrid.GridColor=Colors.Black
Cgrid.HeaderHeight = 30dip

Cgrid.HeaderTextSize = 13
Cgrid.RowTextSize = 13
Cgrid.HeaderTextColor = Colors.Black
Cgrid.RowTextColor = Colors.Black
Cgrid.SelectedOddColor = Colors.RGB(192,192,255)
Cgrid.SelectedEvenColor = Colors.RGB(192,192,255)


NomColu1="Documento": LonColu1=100dip
NomColu2="Número": LonColu2=100dip
NomColu3="Importe": LonColu3=100dip


Dim cc(3) As xnGridCol

cc(0).Initialize2 ( NomColu1 , "Campo1" , LonColu1 , Gravity.LEFT+Gravity.CENTER_VERTICAL)
cc(0).HeaderGravity = Gravity.CENTER_VERTICAL + Gravity.CENTER_HORIZONTAL
Cgrid.ColAppend ( cc(0) )
cc(1).Initialize2 ( NomColu2 , "Campo2" , LonColu2 , Gravity.CENTER+Gravity.CENTER_VERTICAL )
cc(1).HeaderGravity = Gravity.CENTER_VERTICAL + Gravity.CENTER_HORIZONTAL
Cgrid.ColAppend ( cc(1) )
cc(2).Initialize2 ( NomColu3 , "Campo3" , LonColu3 , Gravity.RIGHT+Gravity.CENTER_VERTICAL )
cc(2).HeaderGravity = Gravity.CENTER_VERTICAL + Gravity.CENTER_HORIZONTAL
Cgrid.ColAppend ( cc(2) )

MiPanel.AddView(Cgrid,4dip,Nomcli.Top+Nomcli.Height+5dip,LonColu1+LonColu2+LonColu3,92%y)
Cgrid.GridWidth = 1dip

Cgrid.GridCreate2 (False )
End If
 

Attachments

  • grid2.25.jpg
    29.7 KB · Views: 391
  • grid2.50.jpg
    31.2 KB · Views: 361

stefanobusetto

Active Member
Licensed User
Longtime User
@aviario
B4X:
Cgrid.ScrollWidth = 5dip
Cgrid.TransparentColor = Colors.Black
Activity.AddView(Cgrid,4dip,5dip,LonColu1+LonColu2+LonColu3+Cgrid.ScrollWidth,92%y)

update to grid 2.51
 

stefanobusetto

Active Member
Licensed User
Longtime User
It works in the same way the Click event
but it si fired when the row si clicked for a while.
There is a sample in the xnGridSample.zip.
If you need i can post another example.
 

TheMightySwe

Active Member
Licensed User
Longtime User
Aha, i did not have a underscore in long_select

B4X:
Sub gg_long_select
If gg.Multiselect = False Then
  Msgbox ( "LONG : value of the first column = " & gg.GetValue  ( gg.RowSelected , 0    ) , "row selected = " & gg.RowSelected )
  Msgbox ( "LONG : value of the first column = " & gg.GetValue2 ( gg.RowSelected , "cod" ) , "row selected = " & gg.RowSelected )
End If
End Sub
 

TheMightySwe

Active Member
Licensed User
Longtime User
Can you post an example for LongSelect, the one in the file does not work in my project.
 
Last edited:

qsrtech

Active Member
Licensed User
Longtime User
Hi, how do you make an Icon in the grid "fill" such that it fills the entire width/height of the col/row?
 

stefanobusetto

Active Member
Licensed User
Longtime User
you can have icons of the size you like
then you can fine tune the position of the icons in the cells
with the properties
HeaderIconLeft / HeaderIconTop
RowIconLeft / RowIconTop
 

aviario

Active Member
Licensed User
Longtime User
Hello stefanobusetto, long ago when you ask whether the horizontal grid moves have to detect any case, is there any possibility?

Un saludo
Paco
 

stefanobusetto

Active Member
Licensed User
Longtime User
Hola Paco nice to hear you.

I think it can be done (i've found some hints on how i can handle it).
The problem is i've very few time so i'm only fixing the bugs to the lib.
Stefano
 

qsrtech

Active Member
Licensed User
Longtime User
stefanobusetto said:
you can have icons of the size you like
is then you can fine tune the position of the icons in the cells
with the properties
HeaderIconLeft / HeaderIconTop
RowIconLeft / RowIconTop
Thanks for the reply. But just to confirm, The grid doesn't resize the icon to fit?

Also, Is there a way to control the grid from trying to do multiline when the text is longer than the cell?
 

stefanobusetto

Active Member
Licensed User
Longtime User
That's correct. There is no icon auto resize.
There is no way to prevent text wrapping too.
As for this second feature i'll check if can be added.
 

aviario

Active Member
Licensed User
Longtime User
Thanks for the answer, if we are lucky to have and hold some time to do

un saludo
Paco
 

aviario

Active Member
Licensed User
Longtime User
Also, Is there a way to control the grid from trying to do multiline when the text is longer than the cell?[/quote]

Hello, I can control the length of the text and what I do is to the highest line of the Grid

un saludo
Paco
 

stefanobusetto

Active Member
Licensed User
Longtime User
Also, Is there a way to control the grid from trying to do multiline when the text is longer than the cell?

Hello, I can control the length of the text and what I do is to the highest line of the Grid

un saludo
Paco[/quote]
sorry
i've missed this last one
i've received no notification
i'll have a look
 

stefanobusetto

Active Member
Licensed User
Longtime User
@Paco
Added SingleLine property for columns
B4X:
cc(1).SingleLine = True
If set to true text ( wider the the cell ) is kept in one line
otherwise text is splitted in more lines
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…