B4J Question SDFlexGrid Error on RemoveRow

DarkoT

Active Member
Licensed User
Hi to all,
need help... I implemented new functionality to my App with SD_FLEXGRID library... As I'm know, it's not possible to clear grid with routine (FlexGrid1.ClearGrid or similar). I need to go with For next loop and remove row inside of loop:

RemoveRow:
For x = 1 To tblOpenWo.RowCount - 1
    tblOpenWo.RemoveRow(x)
Next

(I hope this will be done for 1000 rec in sec)... but - for this code i received a error!


any help? What I'm doing wrong?

Regards,
DaT
 

Star-Dust

Expert
Licensed User
Longtime User
it's not possible to clear grid with routine
You are wrong
B4X:
tblOpenWo.ClearRows
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
In any case the code is wrong because by exceeding half the grid you go to delete lines that do not exist because as it deletes the number of lines of grid, so the correct code would be like this

B4X:
For x =tblOpenWo.RowCount - 1 to 0 Step-1
    tblOpenWo.RemoveRow(x)
Next

Or so

B4X:
For x =0 to tblOpenWo.RowCount - 1
    tblOpenWo.RemoveRow(0)
Next
 
Last edited:
Upvote 0

DarkoT

Active Member
Licensed User
No, sorry, will not work... The system give me always a error when I want to remove a row from existing grid... I think here should be a error in library... In any case - I have question about "initialling" a grid... What will be your suggestion how to clear already presented data in grid and full fill grid with new data?
(When I use B4XGrid it's really simple - tbl.clear and go to full fill a grid with new data...)

Tnx, DaT
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
I need to check, maybe there's an error in the library release. It is probably an older version with the 0.13 mark.
In the afternoon I'm in the office to do the checks

Also check if the tblOpenWo.ClearRow method exists (without the "s").
 
Upvote 0

DarkoT

Active Member
Licensed User
I need to check, maybe there's an error in the library release. It is probably an older version with the 0.13 mark.
In the afternoon I'm in the office to do the checks

Also check if the tblOpenWo.ClearRow method exists (without the "s").
Thank you @Star-Dust;method .ClearRow exists (for info). If you can check, I will be very greatfull... Thank you in advance; if you need aditional information, just contact me...
Btw - FlexGrid is nice, I'm start using this grid while give me possibility to have INTABLE EDIT (inline editing)... Work nice, great job from your site...
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
As I imagined I am working with an undistributed version and the method has changed its name in this version that I use.

I'll be releasing the updates in the afternoon. I'll post an example of the removeRow command
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
Release ver. 0.14. Try It
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
@Star-Dust - you are my man... Thank you... It's working... Nice job...

Suggestion: Add search field to grid, will be more as useful
Already it was pointed out to me but I didn't have time to implement.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…