[Gambas-user] What exactly does the Clear method in a GridView?

Gianluigi bagonergi at gmail.com
Sat Feb 9 08:32:22 CET 2019


Here it deletes the contents but leaves the lines.
Tested with gtk, gtk3, qt4, qt5.

[System]
Gambas=3.12.90 66b357d (master)
OperatingSystem=Linux
Kernel=4.15.0-45-generic
Architecture=x86_64
Distribution=Ubuntu 18.04.1 LTS
Desktop=UBUNTU:GNOME
Theme=Fusion
Language=it_IT.UTF-8

Regards
Gianluigi

Il giorno sab 9 feb 2019 alle ore 02:29 Bruce <adamnt42 at gmail.com> ha
scritto:

> Hmm, odd.
> It works here (Rows.Count=0 after a Clear).
> Both QT4 and QT5.
> What GUI are you using?
> B
>
> On 9/2/19 11:47 am, T Lee Davidson wrote:
> > On 9/2/18 2:35 PM, Benoît Minisini wrote:
> >> Le 02/09/2018 à 20:33, Benoît Minisini a écrit :
> >>> Le 02/09/2018 à 19:20, Jorge Carrión a écrit :
> >>>> The help says that "Clear the grid static contents".
> >>>> What is this static content composed of?
> >>>> Rows and columns size? Cell content? position on screen?
> >>>>
> >>>> Best Regards
> >>>>
> >>>
> >>> Wait a minute, I'm looking into the source code... :-)
> >>>
> >>
> >> It clears the contents that you defined explicitly (not what you draw
> >> through the Data event) and that is stored inside the GridView
> >> control. And it sets the rows count to zero. But it keeps the columns.
> >>
> >
> > GridView.Clear does not appear to set the rows count to zero.
> >
> > Did I misunderstand this, or has something changed since a *year* ago?
> >
> > ' Gambas class file
> >
> > Public Sub Form_Open()
> >
> >    GridView1.Rows.Count = 10
> >    GridView1.Columns.Count = 2
> >
> >    For x As Integer = 0 To GridView1.Rows.Max
> >      For y As Integer = 0 To GridView1.Columns.Max
> >        GridView1[x, y].Text = x & ":" & y
> >      Next
> >    Next
> >
> > End
> >
> > Public Sub Button1_Click()
> >
> >    GridView1.Clear
> >    GridView1.Refresh ' Makes no difference
> >    Debug GridView1.Rows.Count
> >
> > End
> >
> >
> > ___
> > Lee
> >
> > ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20190209/b5f0b6e1/attachment.html>


More information about the User mailing list