We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Copy from Excel and Paste to a specific location

Thread ID:

Created:

Updated:

Platform:

Replies:

106665 Jan 21,2013 03:23 AM Jan 22,2013 01:31 AM Windows Forms 3
loading
Tags: GridControl
Xinchao
Asked On January 21, 2013 03:23 AM

Hi,

I am using syncfusion 7.3.0.20 and I need some help with GridControl for WinForms. I need to copy data from excel and paste it into GridControl. GridControl is doing a good job here. The only problem is I dont want to always paste to the area starts from "CurrentCell".

I implemented the ClipboardPaste handler and performed some check there. If the data being pasted satisfies a certain condition, I want to move the CurrentCell to a specific location, say (0,1), so that the data would be pasted from this new "origin". I tried CurrentCell.MoveTo(0,1) in ClipboardPaste handler, it didnt work. CurrentCell was indeed moved, but the data was still pasted to the original place.

I am not sure how the paste function works, but it seems that manipulating CurrentCell is not the correct way. Could you please help give some advice on my question? Thanks!


Arun Kumar V [Syncfusion]
Replied On January 21, 2013 06:30 AM

Hi Xinchao,

Thanks for your interest in Syncfusion products.

Query:

Copy paste from excel to current cell.

I have attached a sample based on copy paste cells from excel, I have also attached a video file which shows how the excel values are pasted from the currentcell of the grid.  please make use of it and let me know if the issue is solved.

Sample : Excel Copy paste.zip

Video   : video.zip

Please let me know if you have any other concerns.

Regards,

Arun.


Xinchao
Replied On January 21, 2013 09:22 PM

Hi Arun,

Thanks for your answer. That's a good example to interact with excel. But I want to ask if it is possible to copy from excel and paste to a grid cell other than the CurrentCell? 

 

Thanks

Xinchao


Arun Kumar V [Syncfusion]
Replied On January 22, 2013 01:31 AM

Hi Xinchao,

Thanks for the update.

Query:

Paste in another cell, than current cell.

If you want to paste the current text other than the current cell then you can customize the currentcellchanging event.

Please refer to the following code snippet.

void gridControl1_CurrentCellChanging(object sender, CancelEventArgs e)

        {

            this.gridControl1.CurrentCell.MoveDown(1);

        }

 

Please let me know if you have any other concerns.

Regards,

Arun.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;