Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7586077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:20:08+00:00 2026-05-30T19:20:08+00:00

Possible Duplicate: How to highlight the results of a text in a gridview? I’ve

  • 0

Possible Duplicate:
How to highlight the results of a text in a gridview?

I’ve asked for many times..I got answers but I have no idea how to do it..
I have a textbox for searching a text inside a gridview table..but I don’t know how to do it..please help me
sql database 2008 , asp.net,c#

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T19:20:10+00:00Added an answer on May 30, 2026 at 7:20 pm

    You can user Dataview Rowfilter to repopulate your Gridview to search..

    .....
    .....
    DataView dvData = new DataView(yourDataTableGoesHere);
    dvData .RowFilter = "Name LIKE 'j*'" 
    DGV.DataSource = dvData;
    DGV.DataBind();
    

    Using Jquery to highlight a datagridview when searched

     string SearchString = "";
        protected void Page_Load(object sender, EventArgs e)
        {
    txtSearch.Attributes.Add("onkeyup", "setTimeout('__doPostBack(\'" + txtSearch.ClientID.Replace("_", "$") + "\',\'\')', 0);");
            if (!IsPostBack)
            {
                Gridview1.DataBind();
            }
        }
        protected void txtSearch_TextChanged(object sender, EventArgs e)
        {
             SearchString = txtSearch.Text;
        }
        public string HighlightText(string InputTxt)
        {
            string Search_Str = txtSearch.Text.ToString();
            // Setup the regular expression and add the Or operator.
            Regex RegExp = new Regex(Search_Str.Replace(" ", "|").Trim(), RegexOptions.IgnoreCase);
            // Highlight keywords by calling the
            //delegate each time a keyword is found.
            return RegExp.Replace(InputTxt, new MatchEvaluator(ReplaceKeyWords));
            // Set the RegExp to null.
            RegExp = null;
        }
        public string ReplaceKeyWords(Match m)
        {
            return "<span class=highlight>" + m.Value + "</span>";
        }
    

    reference

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Highlight keywords in a paragraph I have been struggling with the idea
Possible Duplicate: ImageButton doesn’t highlight on click with Transparent background I have made a
Possible Duplicate: disable text highlighting on double click in jQuery I have a program
Possible Duplicate: jquery highlight the link when clicked I have this nav: <div id=nav>
Possible Duplicate: How to highlight a part part of an Input text field in
Possible Duplicate: Highlighting Strings in JavaFX TextArea how to highlight the text in the
Possible Duplicate: jQuery value selector I have this as html: <div style= id=results> <label
Possible Duplicate: highlighting search results in php/mysql I am doing a search with a
Possible Duplicate: How do I linkify text using ActionScript 3 I am using a
Possible Duplicate: Get link and href text from html doc with Nokogiri & Ruby?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.