This is a migrated thread and some comments may be shown as answers.

Full Text Search

4 Answers 136 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nenna
Top achievements
Rank 1
Nenna asked on 28 Oct 2019, 07:39 PM
I have documents stored within a column in a table.  I want to be able to search the documents for a string and return the documents that contain the string with the string highlighted within the document.  Can this be done with the Grid?  If so, please provide me with an example.  

4 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 31 Oct 2019, 03:30 PM

Hi Nenna,

 

There are 3 possible configurations in this case:

1. If the text content is present in the database, the grid can handle the filtering automatically.

2. If the content is not present in the database, but still displayed in the cells as text via custom implementation (e.g. ItemDataBound or PreRender), then you can disable paging and use a CSS filtering by manually highlighting and hiding the rows on the client:
https://www.telerik.com/support/code-library/quick-search---filtering-rows-depending-on-entered-text-instantly-when-paging-is-disabled
-
 https://www.telerik.com/support/kb/aspnet-ajax/details/highlight-text-inside-html-elements-and-templates

3. If the content is only present in the physical files, I am afraid this is not supported by RadGrid. However, here is an idea for a custom implementation:

   3.1. Use a server-side event, like Button1_Click

   3.2. Acquire the content manually by reading the files during the filtering action - read every file manually, check if the filtered value is present in the text content:
https://stackoverflow.com/questions/8037070/whats-the-fastest-way-to-read-a-text-file-line-by-line

   3.3. These rows which contain the files with the filtered value will remain, while for the other rows you can set their Visible property to false.

I hope this will prove helpful. If you prefer options 1 and 2, they are supported officially and we can provide a full working samples for them.

 

Regards,
Eyup
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Nenna
Top achievements
Rank 1
answered on 31 Oct 2019, 03:44 PM

I am interested in 1 and 2.  Please provide with the full working samples for them.

 

Thanks,

 

Nenna

0
Eyup
Telerik team
answered on 05 Nov 2019, 04:00 PM

Hi Nenna,

 

I am sending a very basic runnable filtering sample, which you can run using the steps below:

1. Open Visual Studio
2. File menu
3. Open option
4. Select Web site and target the web site folder.
5. Include a Bin folder with the Telerik dll assemblies.

Basically, this will be the same for approach 1 since you will have the text content provided as database values.

And for approach 2 you can find the required JS code in the provided links in my previous post.

To provide more specific samples, could you modify the provided web site to demonstrate your configuration and open a formal support thread to send it back to us?

 

Regards,
Eyup
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Eyup
Telerik team
answered on 05 Nov 2019, 04:01 PM

Hi,

The RadGrid web site is attached to this post.

Regards,
Eyup
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Nenna
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Nenna
Top achievements
Rank 1
Share this question
or