Page 3 of 3
Posted: Fri Sep 15, 2006 5:48 pm
by srod
Ah, that's a good point; HideGadget() will not function properly on an egrid.
egrid 3 is effectively obsolete as egrid 4 will be a complete replacement. It is looking a lot better at the moment. A few more days before a beta release is viable though.
In the meantime, the following should (untested) hide an egrid:
Code: Select all
HideGadget(egrid_containerID(egrid#))
Posted: Fri Sep 15, 2006 5:56 pm
by drahneir
Yes, it works fine. Thanks.
Posted: Fri Sep 15, 2006 6:31 pm
by drahneir
Well, the RightClick does not work with my egrid.
But with EasyVent it works like a charme.
Thanks again.
Posted: Sat Sep 16, 2006 2:48 pm
by Inf0Byt3
Hey Srod, great stuff you got here! Thanks!
I must ask you something as i can't get it myself*. Well, i add rows in an egrid when the user presses a button (using addgadgetitem). I have a remove button too but when i try to delete the last row, it scrambles, and the last selected cell still remains in the egrid. To delete the rows i use:
Code: Select all
Row = egrid_SelectedRow(31)
If Row <> -1
RemoveGadgetItem(31,Row)
EndIf
What can i do to cleanly delete each selected row when the user presses 'remove'?
* = as allways

Posted: Sat Sep 16, 2006 3:07 pm
by srod
Hi,
I'm aware there's problems when deleting rows. One reason why egrid 4 is about to hit the shelves; a complete rewrite. Could be here later tonight.
For now, try the following (haven't the time to test I'm afraid):
use egrid_HideEdit() to remove the selection box, then delete the row.
Finally, if the egrid is now empty (check CountGadgetItems etc.) then force a repaint of the egrid.
Something like:
Code: Select all
egrid_HideEdit(#grid)
RemoveGadgetItem(#grid, item)
If CountGadgetItems(#grid)=0
InvalidateRect_(GadgetID(#grid), 0)
UpdateWindow_(GadgetID(#grid))
EndIf
See if this works?
Posted: Sat Sep 16, 2006 3:11 pm
by Inf0Byt3
Thank you for your time, that did the trick

. Looking forward to see egrid4

. Success

.