Click here to Skip to main content
15,895,656 members
Home / Discussions / C#
   

C#

 
QuestionHelp regarding datagridview control Pin
anu817-Sep-07 19:57
anu817-Sep-07 19:57 
QuestionApplication + Remoting +Terminal Server Issue. Help Pin
fearless stallion7-Sep-07 18:27
fearless stallion7-Sep-07 18:27 
AnswerRe: Application + Remoting +Terminal Server Issue. Help Pin
Dave Kreskowiak8-Sep-07 3:18
mveDave Kreskowiak8-Sep-07 3:18 
GeneralRe: Application + Remoting +Terminal Server Issue. Help Pin
fearless stallion8-Sep-07 18:05
fearless stallion8-Sep-07 18:05 
Questiontextbox & tab page bugg? Pin
rbuchana7-Sep-07 18:01
rbuchana7-Sep-07 18:01 
AnswerRe: textbox & tab page bugg? Pin
rohitsrivastava7-Sep-07 19:42
rohitsrivastava7-Sep-07 19:42 
GeneralRe: textbox & tab page bugg? Pin
rbuchana8-Sep-07 4:39
rbuchana8-Sep-07 4:39 
Questioncollection editors & component/control designers [modified] Pin
urbane.tiger7-Sep-07 17:31
urbane.tiger7-Sep-07 17:31 
Part 1

I have a component (myComponent) which has a designer class (myComponentDesigner). The only thing the designer does is to override PostFilterProperties to create the attributes of the component's properties.

When a MyComponent object is dropped into the component tray the attributes (Category, Description, ParenthesizePropertyName(sic), TypeConverter etc) are all apparent in the PropertyGrid; fantastic I can get the attributes out of the code!

However, if I have a collection of myComponents which uses a CollectionEditor then the PropertyGrid in the CollectionEditor.CollectionForm ignores the attributes created by myComponentDesigner. Hence all properties are shown in the PropertyGrid as being miscellaneous, all public properties are shown (the designer applies BrowsableAttribute(false) to many properties), all properties are sans description etc etc.

Is this a feature, undesirable though it may be, is it a defect, or as is so often the case, am I doing something wrong by commission or omission.

Before anyone asks, my code unconditionally invokes base.PostFilterProperties after it has added the attributes - evidence of this is that it works when myComponent's are in the tray.


Part 2

I have a Control derived class called Matrix, that is adorned with several Verbs via its designer class, MatrixDesigner. The verbs appear under the glyph and at the bottom of Matrix's property grid as one would expect.

Amongst Matrix's properties are 5 collection objects - List<Layer> and List<Vector> being two examples, each collection has its own CollectionEditor derived Editor. Within the collection editors the CollectionForm.Controls property is scanned to find the PropertyGrid, if it's found (which it always is), its HelpVisible and CommandsVisibleIfAvailable properties are set to true.

The help area in the CollectionForm PropertyGrid shows what one would expect - the values of the property Description attributes of the Collection subjects (e.g. descriptions of the Layer & Vector properties).

However the Commands area shows the Verbs applied to the the Matrix, which are inappropriate, irrelevant & immaterial in the context of a Layer or Vector. If I apply a designer to the Layer or Vector, it's not processed by the IDE - see Part 1.

Also the collected classes (i.e Layer, Vector etc)have a PropertyTab attribute applied to the class definition thus:-

[PropertyTab(typeof(EventsTab), PropertyTabScope.Component)]<br />
class Vector : Component{<br />
.<br />
.<br />
}<br />


The Events Tab(button) shows up erratically, the only nearly sure way of getting it to "stick around" is to add an item to the collection and then remove it. When it is there it shows the appropriate events (e.g Vector.Grow, Layer.Stretch etc), but the generated code is wrong. The event delegates are assigned correctly in the Form1.Designer.cs :-

this.layer2.Stretch += new LayerEventHandler(this.layer2_stretch);

But, the generated code in Form1.cs looks like :-

private void layer2_Stretch(object sender)<br />
{<br />
}<br />


As you can see there's no "LayerEventArgs e" parameter as one would expect. The IDE "knows" it's failed to do the right thing, because it shows an obscure message, the IDE usually crashes a short time later.

I appreciate scanning CollectionForms.Controls to find a PropertyGrid object is "dodgy", but ...

I also find the various buttons and hide them - eg hide the Add and Remove buttons when I need to present a "fixed collection of objects" which can be individually edited but not created or destroyed.


Rgds PhilD




-- modified at 23:48 Friday 7th September, 2007
QuestionHttpWebRequest performance and keep-alive Pin
pattyweb7-Sep-07 13:47
pattyweb7-Sep-07 13:47 
AnswerRe: HttpWebRequest performance and keep-alive Pin
Scott Dorman7-Sep-07 13:54
professionalScott Dorman7-Sep-07 13:54 
QuestionNeed help with panels and forms? Pin
DogMa3x7-Sep-07 12:28
DogMa3x7-Sep-07 12:28 
AnswerRe: Need help with panels and forms? Pin
Skippums10-Sep-07 3:52
Skippums10-Sep-07 3:52 
QuestionRichTextBox DragDrop [modified] Pin
Skippums7-Sep-07 11:37
Skippums7-Sep-07 11:37 
AnswerRe: RichTextBox DragDrop Pin
Dave Kreskowiak7-Sep-07 13:04
mveDave Kreskowiak7-Sep-07 13:04 
QuestionRichTextBox DragDrop Pin
Skippums10-Sep-07 3:40
Skippums10-Sep-07 3:40 
QuestionOverriding ReadOnlyCollection and "Late Population" of the list Pin
J.G.Cda7-Sep-07 11:06
J.G.Cda7-Sep-07 11:06 
QuestionHierarchical hyperlink hype Pin
Istvan4047-Sep-07 10:55
Istvan4047-Sep-07 10:55 
QuestionData Grid View Calculations Pin
jasper0187-Sep-07 10:54
jasper0187-Sep-07 10:54 
AnswerRe: Data Grid View Calculations Pin
Giorgi Dalakishvili7-Sep-07 11:06
mentorGiorgi Dalakishvili7-Sep-07 11:06 
GeneralRe: Data Grid View Calculations Pin
jasper01810-Sep-07 7:20
jasper01810-Sep-07 7:20 
Questioncalculate subitems Pin
andredani7-Sep-07 10:44
andredani7-Sep-07 10:44 
AnswerRe: calculate subitems Pin
Giorgi Dalakishvili7-Sep-07 11:11
mentorGiorgi Dalakishvili7-Sep-07 11:11 
GeneralRe: calculate subitems Pin
andredani7-Sep-07 11:16
andredani7-Sep-07 11:16 
AnswerRe: calculate subitems Pin
Skippums7-Sep-07 11:44
Skippums7-Sep-07 11:44 
GeneralRe: calculate subitems Pin
andredani7-Sep-07 11:52
andredani7-Sep-07 11:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.