4 Answers, 1 is accepted
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
I am interested in 1 and 2. Please provide with the full working samples for them.
Thanks,
Nenna
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
Hi,
The RadGrid web site is attached to this post.
Regards,
Eyup
Progress Telerik