"Invalid FORMATETC stucture" when dragging a custom Gridview onto

Ask a Question related to ASP.NET Building Controls, Design and Development.

  1. #1

    Default "Invalid FORMATETC stucture" when dragging a custom Gridview onto

    I created a simple custom control inherited from a GridView as a test...

    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Web.UI.WebControls;

    namespace CustomControls
    {
    class CustomGridView : GridView
    {
    public string GetSomeValue()
    {
    return "Hello from custom control!";
    }
    }
    }

    The control appears in my toolbox of my web application but when I try to
    drag it onto my webform, I get the error message.

    Dave Guest

  2. Similar Questions and Discussions

    1. the error "invalid plugin detected. Adobe Reader will quit"
      I have gotten the RIKLA from Adobe. And I use the example code BasicPlugin(you can download it from Adobe wetsite) as my plug_in, then, I made the...
    2. "Must declare the variable '@…..'." in GridView/DatailsView with M
      I am testing ASP.NET 2.0 with MS SQL 2000. I get server error: "Exception Details: System.Data.SqlClient.SqlException: Must declare the variable...
    3. "MPS parser unable to parse file" when dragging images from Safari to AI10?
      I'm trying to drag an image from Safari to AI10, but get the message "The MPS parser is unable to parse the file". What does this mean? I can do the...
    4. "viewstate is invalid for this page and might be corrupted" - why does worker process recycling cause this?
      Hi There, I have posted something previously regarding this issue, but I think I have some more concise questions to ask, and would like to get...
    5. "sendmail_from" not set in php.ini or custom "From:" header missing
      Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Lines: 14 Message-ID:...
  3. #2

    Default Re: "Invalid FORMATETC stucture" when dragging a custom Gridview onto

    hi, start with making your class public, by default its private now you
    should be able to drag and drop it on your webform. By default, your class
    is declared 'internal' when an access modifier is not explicitly defined.
    Regards,
    Alessandro Zifiglio
    [url]http://www.AsyncUI.net[/url]

    "Dave" <Dave@discussions.microsoft.com> ha scritto nel messaggio
    news:E4535969-C724-4ACA-9564-2C767265D32E@microsoft.com...
    >I created a simple custom control inherited from a GridView as a test...
    >
    > using System;
    > using System.Collections.Generic;
    > using System.Text;
    > using System.Web.UI.WebControls;
    >
    > namespace CustomControls
    > {
    > class CustomGridView : GridView
    > {
    > public string GetSomeValue()
    > {
    > return "Hello from custom control!";
    > }
    > }
    > }
    >
    > The control appears in my toolbox of my web application but when I try to
    > drag it onto my webform, I get the error message.
    >

    Alessandro Zifiglio Guest

  4. #3

    Default Re: "Invalid FORMATETC stucture" when dragging a custom Gridview onto

    oops, i have a typo in the statement i made earlier. i had said, by default
    the access modifier for a class is "private", i meant to say "internal".
    Apologies.
    Regards,
    Alessandro Zifiglio
    [url]http://www.AsyncUI.net[/url]

    "Alessandro Zifiglio" <AlessandroZifiglio @ -h-o-t-m-a-i-l-c-o-m> ha scritto
    nel messaggio news:%23iCr9FArGHA.4932@TK2MSFTNGP05.phx.gbl...
    > hi, start with making your class public, by default its private now you
    > should be able to drag and drop it on your webform. By default, your class
    > is declared 'internal' when an access modifier is not explicitly defined.
    > Regards,
    > Alessandro Zifiglio
    > [url]http://www.AsyncUI.net[/url]
    >
    > "Dave" <Dave@discussions.microsoft.com> ha scritto nel messaggio
    > news:E4535969-C724-4ACA-9564-2C767265D32E@microsoft.com...
    >>I created a simple custom control inherited from a GridView as a test...
    >>
    >> using System;
    >> using System.Collections.Generic;
    >> using System.Text;
    >> using System.Web.UI.WebControls;
    >>
    >> namespace CustomControls
    >> {
    >> class CustomGridView : GridView
    >> {
    >> public string GetSomeValue()
    >> {
    >> return "Hello from custom control!";
    >> }
    >> }
    >> }
    >>
    >> The control appears in my toolbox of my web application but when I try to
    >> drag it onto my webform, I get the error message.
    >>
    >
    >

    Alessandro Zifiglio Guest

  5. #4

    Default Re: "Invalid FORMATETC stucture" when dragging a custom Gridview o

    Alessandro,

    Thanks! that got me past the error. However, maybe you can help me with a
    new one.

    When I drag and drop the control, I now get "Error Creating Control Unknown
    server tag" in the designer. When I try to compile in VS I get:

    Element 'MyGridView' is not a known element. This can occur if there is a
    compilation error in the Web site.

    My code is:

    <%@ Register Assembly="CustomControls" Namespace="MyCustomControls"
    TagPrefix="cc1" %>

    <cc1:MyGridView id="MyGridView1" runat="server">
    </cc1:MyGridView>

    "Alessandro Zifiglio" wrote:
    > oops, i have a typo in the statement i made earlier. i had said, by default
    > the access modifier for a class is "private", i meant to say "internal".
    > Apologies.
    > Regards,
    > Alessandro Zifiglio
    > [url]http://www.AsyncUI.net[/url]
    >
    > "Alessandro Zifiglio" <AlessandroZifiglio @ -h-o-t-m-a-i-l-c-o-m> ha scritto
    > nel messaggio news:%23iCr9FArGHA.4932@TK2MSFTNGP05.phx.gbl...
    > > hi, start with making your class public, by default its private now you
    > > should be able to drag and drop it on your webform. By default, your class
    > > is declared 'internal' when an access modifier is not explicitly defined.
    > > Regards,
    > > Alessandro Zifiglio
    > > [url]http://www.AsyncUI.net[/url]
    > >
    > > "Dave" <Dave@discussions.microsoft.com> ha scritto nel messaggio
    > > news:E4535969-C724-4ACA-9564-2C767265D32E@microsoft.com...
    > >>I created a simple custom control inherited from a GridView as a test...
    > >>
    > >> using System;
    > >> using System.Collections.Generic;
    > >> using System.Text;
    > >> using System.Web.UI.WebControls;
    > >>
    > >> namespace CustomControls
    > >> {
    > >> class CustomGridView : GridView
    > >> {
    > >> public string GetSomeValue()
    > >> {
    > >> return "Hello from custom control!";
    > >> }
    > >> }
    > >> }
    > >>
    > >> The control appears in my toolbox of my web application but when I try to
    > >> drag it onto my webform, I get the error message.
    > >>
    > >
    > >
    >
    >
    >
    Dave Guest

  6. #5

    Default Re: "Invalid FORMATETC stucture" when dragging a custom Gridview o

    Dave, for me, it works well in the designer when i drag and drop =P
    The same code you pasted, after changing the access modifier to public, that
    is :-)

    So, i dont know what you did to get this error. From the vs.net menu Try to
    do a build - clean solution in the solution that is hosting your custom
    control. And with your custom control as the active project got to the menu
    again and this time do a build - clean "your custom control project". Try
    rebuilding the project, go back to your solution hosting the control and
    drag and drop it from the toolbox, hoping that this might have fixed it.
    Donno what else to suggest since your code example works well for me =P

    Regards,
    Alessandro Zifiglio
    [url]http://www.AsyncUI.net[/url]

    "Dave" <Dave@discussions.microsoft.com> ha scritto nel messaggio
    news:95AEE0B5-4DEB-4363-8D20-206B1FACA74A@microsoft.com...
    > Alessandro,
    >
    > Thanks! that got me past the error. However, maybe you can help me with a
    > new one.
    >
    > When I drag and drop the control, I now get "Error Creating Control
    > Unknown
    > server tag" in the designer. When I try to compile in VS I get:
    >
    > Element 'MyGridView' is not a known element. This can occur if there is a
    > compilation error in the Web site.
    >
    > My code is:
    >
    > <%@ Register Assembly="CustomControls" Namespace="MyCustomControls"
    > TagPrefix="cc1" %>
    >
    > <cc1:MyGridView id="MyGridView1" runat="server">
    > </cc1:MyGridView>
    >
    > "Alessandro Zifiglio" wrote:
    >
    >> oops, i have a typo in the statement i made earlier. i had said, by
    >> default
    >> the access modifier for a class is "private", i meant to say "internal".
    >> Apologies.
    >> Regards,
    >> Alessandro Zifiglio
    >> [url]http://www.AsyncUI.net[/url]
    >>
    >> "Alessandro Zifiglio" <AlessandroZifiglio @ -h-o-t-m-a-i-l-c-o-m> ha
    >> scritto
    >> nel messaggio news:%23iCr9FArGHA.4932@TK2MSFTNGP05.phx.gbl...
    >> > hi, start with making your class public, by default its private now you
    >> > should be able to drag and drop it on your webform. By default, your
    >> > class
    >> > is declared 'internal' when an access modifier is not explicitly
    >> > defined.
    >> > Regards,
    >> > Alessandro Zifiglio
    >> > [url]http://www.AsyncUI.net[/url]
    >> >
    >> > "Dave" <Dave@discussions.microsoft.com> ha scritto nel messaggio
    >> > news:E4535969-C724-4ACA-9564-2C767265D32E@microsoft.com...
    >> >>I created a simple custom control inherited from a GridView as a
    >> >>test...
    >> >>
    >> >> using System;
    >> >> using System.Collections.Generic;
    >> >> using System.Text;
    >> >> using System.Web.UI.WebControls;
    >> >>
    >> >> namespace CustomControls
    >> >> {
    >> >> class CustomGridView : GridView
    >> >> {
    >> >> public string GetSomeValue()
    >> >> {
    >> >> return "Hello from custom control!";
    >> >> }
    >> >> }
    >> >> }
    >> >>
    >> >> The control appears in my toolbox of my web application but when I try
    >> >> to
    >> >> drag it onto my webform, I get the error message.
    >> >>
    >> >
    >> >
    >>
    >>
    >>

    Alessandro Zifiglio Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139