B4J Library [B4X] [XUI] SD FlexGrid (Table)

Star-Dust

Expert
Licensed User
Longtime User
Create a For loop for the cells you want to clear the contents and then use SetCellValue (Row As Int, Col As Int, Value As Object)
If you want to completely eliminate the rows, use the RemoveRow (Row As Int) command
 

Pravee7094

Active Member
Can I save this data in SQLite Database? How?
 

Pravee7094

Active Member
Hi sir,
How can I add more than six columns? Is there possible? or only can add within 6 columns?

Regards
Praveen
 

Star-Dust

Expert
Licensed User
Longtime User
Can I save this data in SQLite Database? How?
Hi sir,
it is possible to load, update or insert data from a database or to a database, building the procedure. there is no automatic procedure. You will have to read the cell values and update or add to the database.


Hi sir,
How can I add more than six columns? Is there possible? or only can add within 6 columns?

Regards
Praveen
I find this question strange. I don't read anywhere that it says there is a limit of rows or columns. Rather there are properties that let you know the number of rows and columns, so anyone would assume that there is no fixed number. Maybe you phrased the question wrong and wanted to ask something else?
 

Pravee7094

Active Member
Hello Sir, Thanks for your response.
If I add more than six columns, That error will be appear. What can I do sir.

B4X:
    if_flexgrid.ColsName=Array As String("Barcode","ItemName","Price","BeforeTax","AfterTax","SalesPrice","cc")
    if_flexgrid.ColsWidth=Array As Int(75dip,75dip,75dip,75dip,75dip,75dip,75dip)

Error Message:

Error occurred on line: 42 (Main)
java.lang.IndexOutOfBoundsException: Index: 6, Size: 6
at java.util.ArrayList.get(ArrayList.java:437)
at anywheresoftware.b4a.objects.collections.List.Get(List.java:117)
at b4a.example.flexgrid._createheader(flexgrid.java:872)
at b4a.example.flexgrid._invalidate(flexgrid.java:1668)
at b4a.example.flexgrid._setcolswidth(flexgrid.java:2306)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:777)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:354)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at b4a.example.main.afterFirstLayout(main.java:105)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:83)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:226)
at android.app.ActivityThread.main(ActivityThread.java:7178)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:503)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:942)

Any suggestion or Help?

Regards
Praveen
 

Pravee7094

Active Member
sorry sir, My mistake. Solved
 

Sabotto

Well-Known Member
Licensed User
Maybe he was misled by the example, where there are just 6 columns ...
B4X:
FlexGrid1.ColsName=Array As String("","N","On","Name","Img","Digit")
FlexGrid1.ColsWidth=Array As Int(75dip,50dip,50dip,100dip,60dip,100dip)
 

Star-Dust

Expert
Licensed User
Longtime User
In the Design you set the number of columns
 

Star-Dust

Expert
Licensed User
Longtime User
padding to cells?
 

dwsands

Member
Licensed User
Longtime User
padding to cells?
What I am calling padding is the space between the content and the border of the cell so that the content isn't jammed up against the cell border. It could also be called whitespace or a margin.
 

Star-Dust

Expert
Licensed User
Longtime User
It is not possible to change the thickness of the frame that distances the view from the grids.
 

Pravee7094

Active Member
Hi sir,

I used your inline editable table. Your work just awesome.
In mobile mode, Border cell was worked as perfect.
But In tablet mode, I can't see the Border cell. It doesn't work as well.

Any Suggestion sir?
Thank you
 

Pravee7094

Active Member
How I set, No one could not edit this specific column?

B4X:
Sub if_flexgrid_CellClick(Row As Int, Col As Int)
    If Col=0 Then
        if_flexgrid.SelectRow(Row)
    Else
        Select if_flexgrid.GetTypeCol(Col)
            Case if_flexgrid.TypeString
                Dim S As String = if_flexgrid.GetCellValue(Row,Col)
                Log("Cell content: " & S)
                if_flexgrid.EditCellonsite(Row,Col)
        End Select
    End If

End Sub

In the above coding can edit every "typestring" method.

But I want another one. Here
For example, I have two columns. one is "Fullname" and another one is "mobilenumber" both are "typestring" method
but I want "Fullname" field as editable and "mobilenumber " field is not editable. But both are "typestring" method

How to do that?
Any suggestion ?

Thanks
Praveen
 

Star-Dust

Expert
Licensed User
Longtime User
B4X:
Sub if_flexgrid_CellClick(Row As Int, Col As Int)
    If Col=0 Then
        if_flexgrid.SelectRow(Row)
    Else if Col=2 Then ' Col-2 is  Fullname Column
               Dim S As String = if_flexgrid.GetCellValue(Row,Col)
               Log("Cell content: " & S)
               if_flexgrid.EditCellonsite(Row,Col)
    End If

End Sub
 

Star-Dust

Expert
Licensed User
Longtime User
I have not encountered this problem.
I have attached the screenshot of the test I did

 

Pravee7094

Active Member
Hi sir,
For example, I have 10 columns in the table.
I want to Hide particular 5 columns from the table.
I mean I should set visible false.

Can I do that in this table?
Any suggestion?

Thanks
 
Reactions: omo
Cookies are required to use this site. You must accept them to continue using the site. Learn more…