| | |
highlighting search results in a gridview problem
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2008
Posts: 41
Reputation:
Solved Threads: 0
hi, i have a gridview search which filters the gridview, displaying the search results, however it wont highlight the results in yellow:
can any1 see a problem?
cheers
c# Syntax (Toggle Plain Text)
//Highlight relevant search results public string Highlight() { //Declaring a variable to hold search query string s = txtSearch.Text; if (s != null) { //string Search_Str = txtGrid.Text.ToString(); // Setup the regular expression Regex RegExp = new Regex(s.Replace(" ", "|").Trim(), RegexOptions.IgnoreCase); //Highlight keywords by calling the delegate //each time a keyword is found. return RegExp.Replace(s, new MatchEvaluator(ReplaceKeyWords)); // Set the RegExp to null. //RegExp = null; } else { return s; } } // Method which helps find and highlight search results public string ReplaceKeyWords(Match m) { return "<span class=highlight>" + m.Value + "</span>"; }
can any1 see a problem?
cheers
BETTER YOU VISIT:
http://www.highoncoding.com/Articles...w_Control.aspx
http://www.highoncoding.com/Articles...w_Control.aspx
MARK AS SOLVED if its help you.
REGARDS
MCTS - Shawpnendu bikash maloroy
http://shawpnendu.blogspot.com
REGARDS
MCTS - Shawpnendu bikash maloroy
http://shawpnendu.blogspot.com
![]() |
Other Threads in the ASP.NET Forum
- Previous Thread: CSS for asp:button control
- Next Thread: To search records
| Thread Tools | Search this Thread |
.net 2.0 3.5 activexcontrol advice ajax asp asp.net bc30451 beginner bottomasp.net browser businesslogiclayer button c# c#gridviewcolumn cac checkbox child class click commonfunctions compatible confirmationcodegeneration content contenttype control countryselector courier css database datagrid datagridview datagridviewcheckbox datalist deadlock deployment development dgv dialog dropdownmenu dynamic edit embeddingactivexcontrol expose feedback findcontrol flash flv formatdecimal forms formview gridview homeedition iframe iis javascript jquery list menu mono mssql multistepregistration nameisnotdeclared novell objects order problem ratings rotatepage save search security serializesmo.table silverlight smartcard sql sqlserver2005 ssl suse textbox tracking treeview typeof unauthorized validation vb.net video virtualdirectory vista visual-studio visualstudio vs2008 web webarchitecture webdevelopemnt webdevelopment wizard xml youareanotmemberofthedebuggerusers





