Copy / Paste, Excel To flexgrid

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • VoTiger

    Copy / Paste, Excel To flexgrid

    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

  • Samuel Shulman

    #2
    Re: Copy / Paste, Excel To flexgrid

    Are you trying programmaticall y?


    "VoTiger" <christophe.mar celino@gmail.co mwrote in message
    news:1153144108 .460971.43720@s 13g2000cwa.goog legroups.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
    >

    Comment

    • VoTiger

      #3
      Re: Copy / Paste, Excel To flexgrid

      Yes, in VB.NET.

      Regards,

      ----

      C.Marcelino

      Comment

      • Samuel Shulman

        #4
        Re: Copy / Paste, Excel To flexgrid

        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


        "VoTiger" <christophe.mar celino@gmail.co mwrote in message
        news:1153148929 .362348.203370@ m73g2000cwd.goo glegroups.com.. .
        Yes, in VB.NET.
        >
        Regards,
        >
        ----
        >
        C.Marcelino
        >

        Comment

        • IdleBrain

          #5
          Re: Copy / Paste, Excel To flexgrid

          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.
          Provides methods to place data on and retrieve data from the system Clipboard. This class cannot be inherited.


          Finally, use a table to write into flexgrid.

          Hope it helps.

          Comment

          • VoTiger

            #6
            Re: Copy / Paste, Excel To flexgrid

            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.G etdata(). 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

            Comment

            • IdleBrain

              #7
              Re: Copy / Paste, Excel To flexgrid

              Hai:
              Have you tried using IDataObject.Get Data (Type) as mentioned in:


              Also check out IDataObject.Get Formats () as mentioned in:
              Returns a list of all formats that data stored in this instance is associated with or can be converted to.



              Hope it helps.

              Comment

              • VoTiger

                #8
                Re: Copy / Paste, Excel To flexgrid

                Thank you for your reply idlebrain.

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

                Regards,

                ----

                C.Marcelino

                Comment

                Working...