Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Niggling icon
Message
General information
Forum:
ASP.NET
Category:
Visual Studio
Title:
Environment versions
Environment:
C# 4.0
Miscellaneous
Thread ID:
01503462
Message ID:
01504063
Views:
48
But DataTable doesn't derive from ComponentModel.Component.
Of course the ability to open the file in designer mode allows you to do really useful things like adding a button to a DataTable :-}

>I don't think there's any way around this short of modifying the default file types in Visual Studio. This behavior exhibits for any class that derives off Component - which is quite a few of the older classes.
>
>Pretty annoying but easy enough to work around.
>
>+++ Rick ---
>>Hi,
>>
>>Never noticed this before but say I create a .cs file with just this:
class SomeClass {}
>>class DTClass : System.Data.DataTable { }
The presence of the DataTable derived class (even though it is not the first in the file) causes VS to show this in Solution Explorer with the 'Component' icon' rather than the expected 'C#'
>>
>>As an added annoyance it also includes the 'View Designer' option in the context menu and, of course, using this fails because the DTClass is not the first class in the file. Can't seem to find a way to avoid this behaviour - but at least it doesn't attempt to open the Designer view by default....
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform