[Gambas-user] search in gridview or columnview
Peter Mathijssen
pmathijssen at ...626...
Tue Jun 3 20:30:11 CEST 2008
Hi Stefano,
Stupid me, i forgot to set the selection mode. Shame on me.
Now it works.
Peter
2008/6/3 Stefano Palmeri <rospolosco at ...152...>:
> Il Tuesday 03 June 2008 20:10:27 Peter Mathijssen ha scritto:
> > Hi Stefano,
> >
> > I put this in a gridview_click event
> >
> > GridView1.Rows[LAST.row].Selected = TRUE
> >
> > But nothing happens, when i use print last.row it works fine.
> >
> > Peter
> >
>
> But when you click on a row it's automatically selected;
> the row should turn its background color.
> I can't understand.
>
> Stefano
>
> > 2008/6/3 Stefano Palmeri <rospolosco at ...152...>:
> > > Il Tuesday 03 June 2008 19:04:08 Peter Mathijssen ha scritto:
> > > > Hi Stefano,
> > > >
> > > > Thank you very much. I played a bit with your code and changed it to:
> > > >
> > > >
> > > > DIM iCountCol, iCountRow AS Integer
> > > >
> > > > IF Len(txtsearch.text) = 0 THEN RETURN
> > > >
> > > > GridView1.Mode = Select.Multiple
> > > >
> > > > FOR iCountRow = 0 TO (GridView1.Rows.Count - 1)
> > > > FOR iCountCol = 0 TO (GridView1.Columns.Count - 1)
> > > > IF InStr(GridView1[iCountRow, iCountCol].Text,
> txtsearch.Text)
> > > > >
> > >
> > > 0
> > >
> > > > THEN
> > > > GridView1.Rows[iCountRow].Selected = TRUE
> > > > ELSE
> > > > GridView1.Rows[iCountRow].Selected = FALSE
> > > > ENDIF
> > > > NEXT
> > > > NEXT
> > > >
> > > > This way rows get selected when only a part of the text is found. I
> put
> > >
> > > the
> > >
> > > > routine in a textbox_change event.
> > > >
> > > > Do you know how to get the row that has been clicked on with the
> mouse.
> > > > I want to select it.
> > >
> > > PUBLIC SUB GridView1_Click()
> > >
> > > PRINT LAST.Row
> > >
> > > END
> > >
> > > > I wonder is a gridview right for this sort of thing, or is a
> columnview
> > > > better?
> > >
> > > I don't know :-)
> > > It really depends on what you're doing...
> > >
> > > Stefano
> > >
> > > > Peter
> > > >
> > > > 2008/6/3 Stefano Palmeri <rospolosco at ...152...>:
> > > > > Il Tuesday 03 June 2008 14:08:33 Peter Mathijssen ha scritto:
> > > > > > Hello,
> > > > > >
> > > > > > I have a application in wich i want to use a columnview or a
> > >
> > > gridview.
> > >
> > > > > > I
> > > > >
> > > > > am
> > > > >
> > > > > > searching for some code to search the gridview or columnview for
> a
> > > > > > piece
> > > > >
> > > > > of
> > > > >
> > > > > > text. The grid will be two columns wide.
> > > > > > I want the rows that contain the found text selected.
> > > > > >
> > > > > > I found a piece of code to search a columnview but it doesn't do
> > > > > > exactly what i want.
> > > > >
> > > > > I've attached a gridview example. It selects rows which contains
> > >
> > > "hello".
> > >
> > > > > > I am in the proces of making this app. that i developed in
> > > > > > realbasic
> > > > >
> > > > > again
> > > > >
> > > > > > in gambas.
> > > > > > http://plekzondernaam.wordpress.com/not2complex/
> > > > > >
> > > > > > The gambas version looks like this now:
> > > > > > http://img112.imageshack.us/img112/8049/not2complexgambasky5.png
> > > > > >
> > > > > > I am also looking for a piece of code to fill the gridview or
> > > > > > columnview with a tab-delimited file. So one piece of text goes
> in
> > > > > > column 1 and the other piece in column 2.
> > > > >
> > > > >
> --------------------------------------------------------------------
> > > > > DIM sStringArray as String[]
> > > > > DIM sWord as string
> > > > >
> > > > > sStringArray = split(file.load("path to file"), "\t")
> > > > >
> > > > > for each sWord in sStringArray
> > > > >
> > > > > 'here fill the grid
> > > > >
> > > > > next
> > > > >
> > > > > ---------------------------------------------------
> > > > >
> > > > > bye
> > > > >
> > > > > > Does someone have this already?
> > > > > >
> > > > > > Thanks in advance.
> > > > > >
> > > > > > Peter Mathijssen
> > >
> > > -----------------------------------------------------------------------
> > >
> > > > > >-- This SF.net email is sponsored by: Microsoft
> > > > > > Defy all challenges. Microsoft(R) Visual Studio 2008.
> > > > > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> > > > > > _______________________________________________
> > > > > > Gambas-user mailing list
> > > > > > Gambas-user at lists.sourceforge.net
> > > > > > https://lists.sourceforge.net/lists/listinfo/gambas-user
> > >
> > >
> -------------------------------------------------------------------------
> > >
> > > > > This SF.net email is sponsored by: Microsoft
> > > > > Defy all challenges. Microsoft(R) Visual Studio 2008.
> > > > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> > > > > _______________________________________________
> > > > > Gambas-user mailing list
> > > > > Gambas-user at lists.sourceforge.net
> > > > > https://lists.sourceforge.net/lists/listinfo/gambas-user
> > > >
> > > >
> -----------------------------------------------------------------------
> > > >-- This SF.net email is sponsored by: Microsoft
> > > > Defy all challenges. Microsoft(R) Visual Studio 2008.
> > > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> > > > _______________________________________________
> > > > Gambas-user mailing list
> > > > Gambas-user at lists.sourceforge.net
> > > > https://lists.sourceforge.net/lists/listinfo/gambas-user
> > >
> > >
> -------------------------------------------------------------------------
> > > This SF.net email is sponsored by: Microsoft
> > > Defy all challenges. Microsoft(R) Visual Studio 2008.
> > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> > > _______________________________________________
> > > Gambas-user mailing list
> > > Gambas-user at lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >
> > -------------------------------------------------------------------------
> > This SF.net email is sponsored by: Microsoft
> > Defy all challenges. Microsoft(R) Visual Studio 2008.
> > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> > _______________________________________________
> > Gambas-user mailing list
> > Gambas-user at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
More information about the User
mailing list