I need to search from a TextBox and select text in a certain column of a gridview, any ideas?
Thanks.
Find and select text in a gridview column
- gambafeliz
- Posts: 141
- Joined: Friday 2nd September 2022 7:50pm
- Location: I live in the same city as Picasso
Find and select text in a gridview column
For your misfortunes I am Spanish and I only know Spanish, please, be patient with me, Thank you.
- BruceSteers
- Posts: 1575
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: Find and select text in a gridview column
I don't think you can as it's a gridview cell not a textarea that has selection methods.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.
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
BruceS
- gambafeliz
- Posts: 141
- 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
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.
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.