Android Question Scroll problem in Tableview

junaidahmed

Well-Known Member
Licensed User
Longtime User
I have used TableExampleV1_1_13_2D for populating records in table.this example works fine but when I scroll down the scrollview the last row of a table shows as duplicate.pls advise how to resolve this uses.
 

junaidahmed

Well-Known Member
Licensed User
Longtime User
I have used TableExampleV1_1_13_2D for populating records in table.this example works fine but when I scroll down the scrollview the last row of a table shows as duplicate.pls advise how to resolve this uses.

This is my urgent requirement............
pls help ..........
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
I just tried this version downloaded from the forum and it works as expected.
Do you have a screenshot ? Or post your project as a zip file.

Version 1.13 is an 'old' version the latest one is version 1.22, you find it here.

Best regards.
 
Upvote 0

junaidahmed

Well-Known Member
Licensed User
Longtime User
Pls check the attached source code and get back to us

Eagerly awaiting for your prompt reply.

Help ................
 

Attachments

  • TableV122.zip
    502.5 KB · Views: 146
  • Data.jpg
    Data.jpg
    126.2 KB · Views: 187
Upvote 0

klaus

Expert
Licensed User
Longtime User
Add Dim Record(Cols.Length) As String in the code below line 92:
B4X:
        Else If i = 2 Then '-------------------------------------> 'Checking Recordset DataType and based on that set columnwidth
            For J = 0 To Cols.Length - 1
                If Cols(J) = 135 Then
                    cWidth(J)  = 80dip
                Else If Cols(J) =  200 Then
                    cWidth(J)  = 120dip
                Else
                    cWidth(J)  = 65dip
                End If
            Next
        Else
            Dim Record(Cols.Length) As String
            For J = 0 To Cols.Length - 1 '----------------------------------> ' Adding Rows
                Record(J) = Cols(J)
            Next
            Table1.AddRow(Record)
        End If
    Next
    Table1.SetColumnsWidths(cWidth)

Best regards.
 
Upvote 0

junaidahmed

Well-Known Member
Licensed User
Longtime User
Thanks for your quick reply,Now its working fine now.

There is one more issue I am facing that, When I load 20 Columns Data in Table it works fine but the same time when I load 4 Columns Data ,it shows as 4 column & Previous 16 Column in Table (not able to clear previous column after applying table1.clearAll)

Table1.Initialize(Me, "Table1", Cols(i),0,True)
Table1.AddToActivity(PnlRight, 0, 0dip, PnlRight.Width, PnlRight.Height)
Table1.ClearAll


Where Cols(i) --------> Dynamic No of Column
 
Last edited:
Upvote 0

klaus

Expert
Licensed User
Longtime User
In your case, when you call LoadGrid a second time you initialize a second Table instance overlapping the first one and as the second has less columns you see both.
I added the RemoveView method to the Table class so you can remove the previous table and initialize the new one.
Attached your modified project. I added three buttons to show the difference.
You don't need the Table1.ClearAll routine.

Best regards.

EDIT removed the project, new version in post #9.
 
Last edited:
Upvote 0

junaidahmed

Well-Known Member
Licensed User
Longtime User
Thanks Klaus I m very happy for your help........
Sorry for my bad english.

Can u update Footer in Table (This is my sugesstion),So that we can easily summary for numeric column
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Can u update Footer in Table (This is my sugesstion),So that we can easily summary for numeric column
It did exist but there was a problem with the StatusLine update.
You can disable the autofill of the StatusLine with Table1.StatusLineAutoFill = False.
And update the line with Table1.StatusLine = "Test line".
Attached your modified project.
Use the new Table class file in this post.

Best regards.
 

Attachments

  • TableV123.zip
    23.5 KB · Views: 146
Upvote 0

junaidahmed

Well-Known Member
Licensed User
Longtime User
get Error as

Compiling code. Error
Error compiling program.
Error description: Unknown member: statuslineautofill
Occurred on line: 96
Table1.StatusLineAutoFill = False
Word: statuslineautofill
 
Upvote 0

junaidahmed

Well-Known Member
Licensed User
Longtime User
Sorry Klaus,Now its working fine,I have few more request to add functionalities in Table Class

1.Set Alignment for each column such as SetAligmment(left,right,left,center)
2.Need Summary for Each column in Footer.
3.Need Row freeze
 
Upvote 0

junaidahmed

Well-Known Member
Licensed User
Longtime User
2. What do you mean with Summary ?
Answer : All Numeric Column should be display as "Sum" in Footer of a table.


3. What do yu mean with freeze a row ? -----------> Free a Column not as freeze a row

Answer : I have to fixed a first column,when horizontal scrolling
(i.e) First Column Should not be scroll it should be fixed.


Hope its clear for you
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
2. This is too specialized because valid only for numeric columns.
You could manage this with the StatusLine property.
Or why not add a 'special' row at the end of the table ?

3. This would need a very deep modification of the class. No time for this.
I had done this with two ScrollViews in the GPSExample program in the GPSPaths module.
The source code is in the User's Guide SourceCode folder.

Best regards.
 
Upvote 0

junaidahmed

Well-Known Member
Licensed User
Longtime User
Is it possoble to update "Set Alignment for each column such as SetAligmment(left,right,left,center)" as discuss before.Because its most urgent for me
 
Upvote 0
Top