B4A Library Grid/Table and ListView Library

Discussion in 'Additional libraries, classes and official updates' started by stefanobusetto, Mar 28, 2012.

  1. imgsimonebiliato

    imgsimonebiliato Well-Known Member Licensed User

    The code is correct
     
  2. David Hawkins

    David Hawkins Member Licensed 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
     
  3. imgsimonebiliato

    imgsimonebiliato Well-Known Member Licensed User

    With the same code that you wrote:

    Code:
    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
     
  4. David Hawkins

    David Hawkins Member Licensed User

    Hi this is the code I am using 'TimeGrid' is the name of my grid

    Code:
    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
     
  5. stefanobusetto

    stefanobusetto Active Member Licensed User

    Try this please.

    Code:
    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
    :)
     
  6. David Hawkins

    David Hawkins Member Licensed 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
     
  7. stefanobusetto

    stefanobusetto Active Member Licensed User

    Right the sub <....>_CellProps is triggered each time a cell is painted
    :)
     
  8. TheMightySwe

    TheMightySwe Active Member Licensed 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?
     
  9. stefanobusetto

    stefanobusetto Active Member Licensed 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.
    :)
     
  10. TheMightySwe

    TheMightySwe Active Member Licensed User

    I try that!

    Thanks
     
  11. Taha

    Taha Member Licensed User

    Is there plans to introduce sorting by column?
     
  12. stefanobusetto

    stefanobusetto Active Member Licensed 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.
    :)
     
    Taha likes this.
  13. qsrtech

    qsrtech Active Member Licensed 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? ;)
     
  14. stefanobusetto

    stefanobusetto Active Member Licensed User

    You can create 0 width columns.
    :)
     
  15. bl4ck4nt

    bl4ck4nt Member Licensed User

    what i can include EditText in column xnGrid...?
    tx b4 stefano
     
  16. qsrtech

    qsrtech Active Member Licensed User

    Make a the column"s width=0 For just one particular row? Doesn't seem logical

    Also, are you planning on making this awesome grid for b4i?
     
  17. stefanobusetto

    stefanobusetto Active Member Licensed User

    @blck4nt
    No editing features.
    Sorry
    :)
     
  18. stefanobusetto

    stefanobusetto Active Member Licensed User

    @qrstech
    1) You are probably right!
    2) No b4i version (at least for now)
    :)
     
  19. aviario

    aviario Active Member Licensed 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
     
  20. stefanobusetto

    stefanobusetto Active Member Licensed User

    @aviario
    Yes, I'll add.
    Yuo are welcome!
    :)
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice