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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:14:55+00:00 2026-05-24T21:14:55+00:00

I have done for clicking one the datagridview row cell in one form say

  • 0

I have done for clicking one the datagridview row cell in one form say form 1 another form say form 2 will open along with selected data grid view data on form1..

I am using winforms…c#

i have done some operations on datagrid view data and at the end of the operations stage the form2 will be closed

    NOTE :upto this i have  finished

i want to update the datagridview in form1 with changes i have done in form2

for that i have done like this..

form 1:

     private void productGridview_Cellclick(object sender, DataGridViewCellEventArgs e)
     {

         if (e.ColumnIndex != productgridview.Columns["productimage"].Index) return;

            if (productgridview.SelectedCells.Count == 0) return;

            int selectedrowindex= productgridview.SelectedCells[0].RowIndex;

            DataGridViewRow selectedRow = productgridview.Rows[selectedrowindex];
              if (img is Image)
               {
                   using (ProductDescriptionForm pf = new ProductDescriptionForm())
                   {

                       pf.picture = img;
                       pf.productname = productname;
                       pf.description = desc;
                       pf.productprice = productprices;
                       pf.categoryname = categoryCombobox.Text;
                       pf.productid = productids;
                       pf.ShowDialog(this);
                   }
               }
      }

and in form2 : I have done like this …

         public int productid
    {
        get { return _prodid; }
        set { _prodid = value; }

    }
    public Image picture
    {
        get { return pictureBox1.Image; } 
        set { pictureBox1.Image = value; }
    }
   like this  some constructors  i have used and then 

i have deleted one row in datagridview by using below code …its fine..

      private void btnProdDelete_Click(object sender, EventArgs e)
      {
        using(var context = new TsgEclipseEntities())
        {
              var pd = new product(){ product_Id = productid };
              context.products.Attach(pd);
              context.DeleteObject(pd);
              context.SaveChanges();
              this.Close();   // form2 close                   
       }

    }

now i want to update the datagridview in form1 how i have to do that …..

can any one have idea about this …

many thanks….

  • 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-24T21:14:58+00:00Added an answer on May 24, 2026 at 9:14 pm

    1) write a databind method that accepts a product_id parameter to get data in form 1
    2) Before form2.close, intialize form 1 class, and call the method by passing the product_id you just updated and open form1.

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

Sidebar

Related Questions

I have done a hide and show of a div element, on clicking a
I Have done a site but want to redirect it to another subdomain in
i have done something like this: <form action=validate.php method=get> Id :<input type=text name=pID/><br/><br/> Name
I have done the following form <% form_for @anexo, :url => {:action => create},
I have an application with one main form. In the form I have one
I have an editable Jqgrid(where when im clicking on a row, that row get
I have a form with lots of data. There is a Submit button. Upon
hii, I am using devexpress xtrascheduler.In this i have created one custom form which
I have 3 jsp pages(index.jsp, result1.jsp,result2.jsp) and one servlet . Processing is being done
Have done some research and found some stuff that may be helpful. I would

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.