Hi everyone,
I have a datagrid form with each row having 3 text fields.
It is taking in data from a sqlite file.
I also have a search box.
I would like to type a query into the search box and have it highlight every 
instance it appears in the datagrid. I also want to count the number of times if occurs.
The find command works for only the data that is visible on the card. When i scroll down, I have to re enter text in the search box to find the next instance of the word I am looking for. Is there any other way I can achieve my objective?
Thank you.
Regards,
Gautami
			
			
									
									
						Datagrid Search
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Datagrid Search
Hi Gautami,
This isn't exactly what you asked for but it may help:
http://quartam.blogspot.com/2010/07/dat ... ample.html
Simon
			
			
									
									This isn't exactly what you asked for but it may help:
http://quartam.blogspot.com/2010/07/dat ... ample.html
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
						Re: Datagrid Search
Hi Simon,
Thank you!
I will look into this
Thanks for helping.
G
			
			
									
									
						Thank you!
I will look into this

Thanks for helping.
G
Re: Datagrid Search
You can always put the dgText of your DG into a variable, and do a search for your text with something like
This will give a list of the line numbers that either contain your text or equal it. You can then go back to the DG and set the DGHilitedLiines.
Craig Newman
			
			
									
									
						Code: Select all
function revFullFind tText,tFind,exactly --RETURNS LINE NUMBER & "," & WORD NUMBER
   put 0 into counter
   switch exactly
      case "true"
      case empty
         repeat for each line tline in tText
            add 1 to counter
            if tFind = tline then
               put counter & return after tResult
            end if
         end repeat
         break
      case "false"
         repeat for each line tline in tText
            add 1 to counter
            if tFind is in tline then
               repeat with y = 1 to the number of words in tLine
                  if word y of tLine = tFind then put y & "," after temp
               end repeat
               delete last char of temp
               put counter & "," & temp & return after tResult
               put "" into temp
            end if
         end repeat
         break
   end switch
   return tResult
end revFullFindCraig Newman
