Home All Groups Group Topic Archive Search About

Copy / Paste, Excel To flexgrid

Author
17 Jul 2006 1:48 PM
VoTiger
Hi everyone,

i am ttrying to find a way to do the copy / paste between an existing
excel file and my flexgrid (in runtime application). But the fact is
that i don't know how to proceed.

The thing that i am trying to do is to code this : A man can do ctrl+c
in an excel application and do ctrl+v in his flexgrid (in runtime mode)

Regards,

----

C.Marcelino

Author
17 Jul 2006 2:06 PM
Samuel Shulman
Are you trying programmatically?


Show quoteHide quote
"VoTiger" <christophe.marcel***@gmail.com> wrote in message
news:1153144108.460971.43720@s13g2000cwa.googlegroups.com...
> Hi everyone,
>
> i am ttrying to find a way to do the copy / paste between an existing
> excel file and my flexgrid (in runtime application). But the fact is
> that i don't know how to proceed.
>
> The thing that i am trying to do is to code this : A man can do ctrl+c
> in an excel application and do ctrl+v in his flexgrid (in runtime mode)
>
> Regards,
>
> ----
>
> C.Marcelino
>
Author
17 Jul 2006 3:08 PM
VoTiger
Yes, in VB.NET.

Regards,

----

C.Marcelino
Author
17 Jul 2006 5:49 PM
Samuel Shulman
I don't know of such a simple method but you may access the data of the
Excel sheet via the Object Model of Excel and then populate the data into
the GridControl

You have to consider the following
How will the program know the path of the file
How to use the object model, if you haven't used it before it is not so easy

Another method if the file can be .csv then you can read it and parse it
yourself that should be quite easy

hth,
Samuel Shulman


Show quoteHide quote
"VoTiger" <christophe.marcel***@gmail.com> wrote in message
news:1153148929.362348.203370@m73g2000cwd.googlegroups.com...
> Yes, in VB.NET.
>
> Regards,
>
> ----
>
> C.Marcelino
>
Author
17 Jul 2006 6:44 PM
IdleBrain
Hello Samuel,

If you want the user to press Ctrl+C to copy, Ctrl+V to paste:

Use KeyData of the KeyUp event to sense Ctrl + V press by the user.

Checkout how the results can be copied from the clipboard into your
application.
http://msdn2.microsoft.com/en-us/library/system.windows.forms.clipboard.aspx

Finally, use a table to write into flexgrid.

Hope it helps.
Author
18 Jul 2006 7:33 AM
VoTiger
Thank you IdleBrain and Samuel for your both help. As IdleBrain said i
am using the Clipboard control and it is working perfectly using the
method GetDataObject.Getdata(). But the thing that disturb me is that i
am getting just the text and i would like to have the object that
contains the type of the value and the text. If someone has any idea to
make this i would truely appreciate.

Regards,

----

C.Marcelino
Author
18 Jul 2006 11:48 AM
IdleBrain
Hai:
Have you tried using IDataObject.GetData (Type) as mentioned in:
http://msdn2.microsoft.com/en-us/library/system.windows.forms.idataobject.getdata.aspx

Also check out IDataObject.GetFormats () as mentioned in:
http://msdn2.microsoft.com/en-us/library/system.windows.forms.idataobject.getformats.aspx


Hope it helps.
Author
18 Jul 2006 12:20 PM
VoTiger
Thank you for your reply idlebrain.

I will try to see that, and will tell if it works.

Regards,

----

C.Marcelino