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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:56:27+00:00 2026-05-27T04:56:27+00:00

I’m here again asking questions. I hope somebody would put some effort in answering

  • 0

I’m here again asking questions. I hope somebody would put some effort in answering this question.

So I have a datagrid view which had values from my database. I have a search button in my form which opens a new form and then there, there is a textbox which you can write the string that you want to search. The question is, How can do that to search and update my datagridview.

for ex. My datagrid view has the following values:

name:
adam lewis,
adam sandler,
justin bieber,
rebecca black

if i search only “adam” after I clicked ok and that 2nd form gets closed
my datagrid view will update and will only show names which has adam on it.

name:
adam lewis,
adam sandler

**My Datagrid’s values is bound by a datatable.

Just comment below if you don’t understand the question and I will put pictures of my gui if that will help. THANK YOU VERY MUCH STACKOVERFLOW!!

it looks like this…
enter image description here
enter image description here

Here’s a video example:
http://www.youtube.com/watch?v=1OjZwBqVSVI

  • 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-27T04:56:27+00:00Added an answer on May 27, 2026 at 4:56 am

    What part of it do you need help though? The general idea is this, you want to be able to control your main form from your search form. You can do this:

    In your main form you do 2 things implement UpdateDatatable and add an event handler on search button click:

    private void Search_Click(object sender, EventArgs e)
    {
           SearchForm mySearchForm = new SearchForm();
           mySearchForm.SetMainForm(this);
           mySearchForm.Show();
    }
    public void UpdateDatatable(string searchWord)
    {
    //write your own code to update your datagridview by updating the datatable, filtering the datatable or creating a new datatable by using the parameter searchWord.  I am saying datatable because I assume your datagridview is bound to a datatable.
    }
    

    In your search form:

    public partial class SearchForm : Form
    {
        private Form mainForm;
        public SearchForm()
        {
            InitializeComponent();
        }
        public void SetMainForm(Form fromMainForm)
        {
            mainForm = fromMainForm;
        }
    
        private void txtSearchWord_TextChanged(object sender, EventArgs e)
        {
            mainForm.UpdateDatatable(txtSearchWord.text);
        }
    }
    

    Hope this helps

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
This could be a duplicate question, but I have no idea what search terms
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I know there's a lot of other questions out there that deal with this
I don't have much knowledge about the IPv6 protocol, so sorry if the question

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.