XUI FlexGrid

Peter Simpson

Expert
Licensed User
Longtime User
I would avoid free scrolling, since there are column headers.

Incorrect, I would say to keep the free scrolling but move the header left and right to match the free scrolling moving left and right nomatter what position the actually table is in.

Nice job @Star-Dust :)
 

Star-Dust

Expert
Licensed User
Longtime User
I like this a lot. Hopefully one can add their own custom controls on the row columns? Can they?
I do not think I understood correctly
 

Star-Dust

Expert
Licensed User
Longtime User
Please post examples:rolleyes:
B4X:
Private Sub Application_Start (Nav As NavigationController)
    'SetDebugAutoFlushLogs(True) 'Uncomment if program crashes before all logs are printed.
    NavControl = Nav
    Page1.Initialize("Page1")
    Page1.Title = "Page 1"
    Page1.RootPanel.Color = Colors.White
    NavControl.ShowPage(Page1)
    Page1.RootPanel.LoadLayout("Layout1")
 
    FlexGrid1.ColsName=Array As String("Num","Selc","Name","Img","Digit")
    FlexGrid1.ColsWidth=Array As Int(75dip,50dip,100dip,60dip,150dip)
    FlexGrid1.ColsType=Array As Int(FlexGrid1.TypeInt,FlexGrid1.TypeCheck,FlexGrid1.TypeString,FlexGrid1.TypeImage,FlexGrid1.TypeFloat)
    FlexGrid1.ColsAlignment=Array As String("CENTER","CENTER","LEFT","LEFT","RIGHT")
 
    Dim B As Boolean=False
    For i=1 To 25
        B=Not(B)
        FlexGrid1.AddRow(Array As Object(i,B,"User " & i,Null,Rnd(50,10000)/100))
    Next
 
    FlexGrid1.SetCell(0,0,100)
    FlexGrid1.SetCell(1,2,"User 200")
    FlexGrid1.SetCell(0,3,LoadBitmap(File.DirAssets,"b4a.png"))
    FlexGrid1.SetCell(2,3,LoadBitmap(File.DirAssets,"b4j.png"))
    FlexGrid1.SetCell(4,3,LoadBitmap(File.DirAssets,"b4i.png"))
    FlexGrid1.Invalidate
End Sub

Sub FlexGrid1_HeadClick(Index As Int) ' Click Header Column
    FlexGrid1.Selectcol(Index) ' Select all cell of column
End Sub

The selection of the row or column you manage as in the example.
While the single / multiple cell selection manages the class
 
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
Incorrect, I would say to keep the free scrolling but move the header left and right to match the free scrolling moving left and right nomatter what position the actually table is in.

Nice job @Star-Dust :)
Video2.gif


Simply iOS works differently than Android. And Scrollview.Panel.Width has a different effect, so I used Scrollview.ContentWidth
 
Last edited:

Star-Dust

Expert
Licensed User
Longtime User

Star-Dust

Expert
Licensed User
Longtime User
I added the possibility also to edit the text inside the cell.
Video5.gif

I am working on the reverse Polish Notation (RPN) in an attempt to add the calculation of formulas inserted into cells, similar to Excel. I hope to succeed.
 

Star-Dust

Expert
Licensed User
Longtime User
Tip: try to release early and later add more features.
I'm afraid there are bugs because I did not have time to try it. Today I added your code in the half-hour break, but I still have to try it.

Then I have to understand whether to integrate your code in or leave it as an external class so as to be modified according to needs.
 
Top