Find and select text in a gridview column

New to Gambas? Post your questions here. No question is too silly or too simple.
Post Reply
User avatar
gambafeliz
Posts: 139
Joined: Friday 2nd September 2022 7:50pm
Location: I live in the same city as Picasso

Find and select text in a gridview column

Post by gambafeliz »

I need to search from a TextBox and select text in a certain column of a gridview, any ideas?

Thanks.
For your misfortunes I am Spanish and I only know Spanish, please, be patient with me, Thank you. :)
User avatar
BruceSteers
Posts: 1523
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Find and select text in a gridview column

Post by BruceSteers »

gambafeliz wrote: Wednesday 16th November 2022 8:58am I need to search from a TextBox and select text in a certain column of a gridview, any ideas?

Thanks.
I don't think you can as it's a gridview cell not a textarea that has selection methods.
A TableView may possibly work as it has edit methods.

Do you just want to select part of the text or the whole cell?

Gridview does support RichText though so you could use html tags to change the text appearance to make it look selected or just highlight it.
GridView1[0, 0].Text = ""  ' you have to clear .Text to use .RichText
GridView1[0, 0].RichText = "Here is <font color=green>green text</font> in the field"
Could be another of those fancy methods that needs you to make a ScrollView and use panels rather than expecting too much from a GridView.
If at first you don't succeed , try doing something differently.
BruceS
User avatar
gambafeliz
Posts: 139
Joined: Friday 2nd September 2022 7:50pm
Location: I live in the same city as Picasso

Re: Find and select text in a gridview column

Post by gambafeliz »

Thank you for your nice help.

I have solved it with a Textbox and in its Keyrelease() event, when I write, I go through the entire gridview and change the color of the text and the one that should not be changed I leave it as default.

Thanks you are the best.
For your misfortunes I am Spanish and I only know Spanish, please, be patient with me, Thank you. :)
Post Reply