Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. Can't 'design' UserControl

Can't 'design' UserControl

Scheduled Pinned Locked Moved .NET (Core and Framework)
visual-studiohelpquestioncsharpdesign
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    moredip
    wrote on last edited by
    #1

    **CROSSPOSTED TO VS .NET IDE ISSUES FORUM** Hi all, I've got a class called RowView derived from UserControl, which is itself the parent of another class (AuthorView). RowView has a public property Data. Since RowView should never be instantiated directly (it's a pseudo-abstract class) it doesn't implement Data, it simply throws a NotSupportedException. My AuthorView class does implement Data. Now my problem is that whenever I try and 'design' AuthorView in VS .NET the designer tries to access RowView.Data, which throws an exception. So my question is, how do I stop VS .NET's designer from attempting to access Data. I've tried settig the Browsable attribute to false in RowView.Data, but it doesn't help. I can post up some code if that'll help clarify the situation. TIA, Pete

    R 1 Reply Last reply
    0
    • M moredip

      **CROSSPOSTED TO VS .NET IDE ISSUES FORUM** Hi all, I've got a class called RowView derived from UserControl, which is itself the parent of another class (AuthorView). RowView has a public property Data. Since RowView should never be instantiated directly (it's a pseudo-abstract class) it doesn't implement Data, it simply throws a NotSupportedException. My AuthorView class does implement Data. Now my problem is that whenever I try and 'design' AuthorView in VS .NET the designer tries to access RowView.Data, which throws an exception. So my question is, how do I stop VS .NET's designer from attempting to access Data. I've tried settig the Browsable attribute to false in RowView.Data, but it doesn't help. I can post up some code if that'll help clarify the situation. TIA, Pete

      R Offline
      R Offline
      Roger Alsing 0
      wrote on last edited by
      #2

      you can always chekc if you are in designmode (this.designmode) and NOT throw the exception if you are in design mode.. not that this is a solution but i suppose it will atleast let you continue working on your controls untill you find a solution for this... //Roger

      M 1 Reply Last reply
      0
      • R Roger Alsing 0

        you can always chekc if you are in designmode (this.designmode) and NOT throw the exception if you are in design mode.. not that this is a solution but i suppose it will atleast let you continue working on your controls untill you find a solution for this... //Roger

        M Offline
        M Offline
        moredip
        wrote on last edited by
        #3

        Funny, that's exactly what I did do :) And I was thinking the same thing: "Hmm, this can't be the right way to do this... Ah well, at least I can keep coding while I wait for some kind of solution.." Thanks Roger, Pete

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups