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 457505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T22:34:41+00:00 2026-05-12T22:34:41+00:00

So I have a dataGridView and a textbox on a form. I want to

  • 0

So I have a dataGridView and a textbox on a form. I want to be able to search through the dataGridView and sort it compared to the string in the text box. ex:
I type “acv” in the text box and all strings containing “acv” are sorted to the top.
I’m accomplishing this with a bunch of gymnastics involving datatable.select and some clearing and filling but it’s ugly and slow. What would be the best practice/proper/normal way to do this?

  • 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-12T22:34:41+00:00Added an answer on May 12, 2026 at 10:34 pm

    Use a filtered DataView and then set your DataGridView’s BindingSource to the Filtered DataView. If the user clears the filter condition, then just set the BindingSource back to your original default view. I recommend you store the view before sorting so you can go back to the original dataview easily. I use this now for sorting fast and it works great. Replace column names with yours. You should be able to modify the dataview from the original DataGridView and apply the filter without re-binding. Just bind your DataGridView to a DataView at the beginning, then retrieve the DataView (i.e. DataSource) and modify. I’m not sure if you are using a BindingNavigator or not. Good luck.

    Dim myDataTable As DataTable = myDataSet.Tables(0)
    Dim myDataView As New DataView(myDataTable)
    
    myDataView.RowFilter = "CompanyName LIKE '%" & ddlAlpha.SelectedItem.Text & "%'"
    myDataView.Sort = "ContactName"
    dataGridView1.DataSource = myDataView
    dataGridView1.DataBind()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a 'search' textbox. When a user enters a text, I want to
I have 2 controls in a resize-able panel (1 datagridview and 1 textbox) with
I have a datagridview with one DataGridViewCheckBoxColumn and some other TextBox Columns. I want
I have four datagridviews and one text box and i want to display a
I have few controls (Label, Custom Textbox, Datagridview) docked on a form. When I
I have datagridview with checkbox column, but I want, that some of the columns
I have a DataGridView bound to a LINQ to SQL query expression. I want
I have a datagridview made up of multiple rows and columns. I want to
I have a DataGridView bound to a DataSet. I only want a selection of
I have a Windows Form VS2010 .NET 4 project with a standard DataGridView bound

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.