Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > Copy and paste from one Datagridview to another Datagridview???
 

Copy and paste from one Datagridview to another Datagridview???

Hi ,
i am trying to implement copy & paste feature from one form to another form.

My first gridview is not databound to any thing,,,,its a gridview with 4 columns in which 2 are read only and in other 2, user should provide input.

Gridview 1: ( this is grid is form1)
productid, productname,qty,price.


Here productid and productname column is readonly. and once i paste productid and productname then user should provide qty and price for the products in respective way.


Now in Gridview 2:(this grid is form2)
productid,productname.

in gridview2, i am binding the data with help of dataset.

Now once i copy the selected rows from gridview into a list<> in form 2 (here list<> is one class type which i have defined below)

Then i want to bind that list<> in grdview1 in form1 with respective columns of gridview.

Can you please help me..

Thanks...

public class Datagridvievalue
    {
        public Datagridvievalue()
        { ;}
        private string _id;
        public string _productId
        {
            get { return _id; }
            set { _id = value; }
        }

        private string _pName;
        public string _productName
        {
            get { return _pName; }
            set { _pName = value; }
        }

        public Datagridvievalue(string id, string name)
        {
            this._id = id;
            this._pName = name;
        }
        
    }
Please help me...

Thanks....
abhi0410  Friday, August 07, 2009 10:18 AM
refer ,
http://www.devnewsgroups.net/group/microsoft.public.dotnet.framework.adonet/topic62493.aspx
NareshG  Friday, August 07, 2009 5:00 PM

We are changing the issue type to “General Discussion�because you have not followed up with the necessary information. If you have more time to look at the issue and provide more information, please feel free to change the issue type back to “Question�by opening the Options list at the top of the post window, and changing the type. If the issue is resolved, we will appreciate it if you can share the solution so that the answer can be found and used by other community members having similar questions.


Please remember to click “Mark as Answer�on the post that helps you, and to click “Unmark as Answer�if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Ling Wang  Monday, August 17, 2009 1:52 AM
Hi Ling.
The issue is not resolved yet....so i kept this aside and moved ahead and come back to this issue again....Actually i did post similar question on the other link and i could reach at one point after giving detail information but i couldn't move ahead after that....i am posting that link over here.

http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/084bc04d-c36d-4b96-af13-5ded1bdb1252

If you could look into the post and help me out there to move forward then it would be great.


Thanks.
Abhishek


abhi0410  Thursday, August 20, 2009 9:27 AM

You can use google to search for other answers

Custom Search

More Threads

• can we bind the SqlCommand directly to the Dataview
• Filling a Combo box
• Primary Key Violations
• null value for databound lookup combo
• Moving From VS2003.Net To VS2005.Net Via VB.Net, Re: SQL Connections
• Populating a winforms treeview control using recursion
• textbox controls problem? i want to clear all textboxes text
• Problem with setting the selected color for row to Transparent
• DataGrid Cells
• OleDbDataAdapter Converts 00:00:01 to 30/12/1899 00:00:01 when loaded from CSV file