Click here to Skip to main content
16,017,638 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi sir,
i am doing aproject to maintain employee database.In that i have a problem of copying data from grid & to paste them as they are, i mean i am copying them in the form of rows and columns and i need to paste them , as like how sholud it be done with help of paste menu ,
i used context menu strip for this menu controls, Cut,Copy,Paste


data base is Access i am reading from it to my grid if i give refernce EmpId And EMPNAME


Some one help me
Posted

Well, you can handle the events of copying and pasting, which means you can create your own format to store data if you want to, or just store as text ( I think I'd store as text using XML and then read that XML to fill my cells on a paste )

The database is irrelevant, you're copying and pasting to and from a UI element, not the db, right ?
 
Share this answer
 
I understood your question perfectly. You asked it twice more, I deleted both. I have answered you. You need to write code to capture the paste event, and then read your data, and write it into your columns and rows. You can't write some code which will magically cause the text you copied to jump into rows and columns, the logical thing to do, is to write code so your copy operation stores the data as XML, so that the row/column data is stored, and then reads that to fill out your grid again. This, of course, means that only your grid will paste the way you want, not other programs. I see no way around this.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900