[Gambas-user] What exactly does the Clear method in a GridView?
Bruce
adamnt42 at gmail.com
Sat Feb 9 09:00:31 CET 2019
Well I was wrong! Had a good look though our local code and found that
our gridview override class does an explicit "Me.Rows.Count = 0" in it's
Clear() method. :-(
(That code (ours) has been around so long, I don't even remember when I,
or someone, implemented the explicit setting of the rows count to zero.)
Which begs the question...
Oh well, sorry about the noise.
b
On 9/2/19 6:02 pm, Gianluigi wrote:
> 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
> <mailto: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 ]----
>
>
>
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>
More information about the User
mailing list