|
I want to hide the + or - sign in the PropertyGrid. For instance, if there are 1 main root level and has 2 child roots levels I only want to display everything expanded but again without having the options to click to minimize or maximize.
MainFolder
|
|
|_____
|
|SubFolder1
|
|SubFolder2
Thanks
|
|
|
|
|
That's not something the PropertyGrid control allows you to suppress.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
In order to do this, you'd have to take over drawing the property grid yourself. It seems like a lot of effort for not really much gain.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi,
Today I opened the definition of Excel.ApplicationClass and I observed that it implements two interfaces called application and _application. Interface _application contains lot of members but interface application is empty and only implements interface _application. So the hierarchy is like this;
interface _application (interface with members in it)
interface application (empty interface) : _application
ApplicationClass (class) : _application, application
So the class ApplicationClass provides definitions to all members in topmost interface _application. My question is that why does this class need to implement the interface _application if it is already implemented by interface application?
Thanks in advance for all the answers by you.
Anil
|
|
|
|
|
A M SOMAN wrote: My question is that why does this class need to implement the interface _application if it is already implemented by interface application?
Good question. I would expect that the answer is because it's autogenerated so don't actually expect it to do anything clever there.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Assume I have class1.
class class1
{
public class1(class1 c1)
{
}
}
What this means ? Why a class needs another instance of the same class to be passed as parameter. I have seen this type of behavior in XmlSerializerNamespaces[^] class. It accepts XmlSerializerNamespaces object in the constructor ? Any idea ?
|
|
|
|
|
This is called a copy constructor[^]. It is used to create a copy of the given object. In .Net, the class should really implement ICloneable[^] though.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
That's new to me. Do you have any c# links explaining this ? Why we use this ? I found that it is making a copy of object, so how parameters are passed to constructor ?
|
|
|
|
|
The link I provided is for C++, but the same concept applies to C#.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
And yet is still isn't generic
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
TJoe wrote: In .Net, the class should really implement ICloneable
Not so quick, read Community Content down there
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
I did and I doubt Jonathan speaks for Microsoft. I agree with wekempf's last post. Copy constructor does specify whether it's a deep or shallow copy either. In addition, the ICloneable allows derived classes to more easily override the copy behavior. Finally, there is no way (aside from reflection) to tell if an object has a copy constructor. With the ICloneable interface, you can easy do "if (obj is ICloneable)".
-- Update: I see now that the MS guidelines recommend to not use it. But there are still applications for this interface.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
I'm not going to join debate about copy ctor vs ICloneable now However I wanted to point out there is a debate.
TJoe wrote: -- Update: I see now that the MS guidelines recommend to not use it.
This is where I first saw that
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
N a v a n e e t h wrote: Why a class needs another instance of the same class to be passed as parameter.
You can use this pattern when you want to inicalize your instance using copy of data from another instance.
If you look at XmlSerializerNamespaces with Reflector, you see:
public XmlSerializerNamespaces(XmlSerializerNamespaces namespaces)
{
this.namespaces = null;
this.namespaces = (Hashtable) namespaces.Namespaces.Clone();
}
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
Yes that made it clear. Thanks
|
|
|
|
|
For data / transactional apps such as LOB, we all want the user to view and update an object (which is usually OR mapped to a datastore) or a list of objects.
I am looking for a UI control which generates a screen at runtime based on the properties AND methods of an object. The PropertyGrid of the ComponentModel does a wonderful job but I cannot present that to users.
Also, its Reflection/Attribute driven model means the end-users cannot influence many of the display characteristics. I am fully prepared to implement an interface which the UI control imposes on me.
Such an interface can request the properties to display, the order, the category, which are updateable, default values, help, and whatever other wonderful things the UI control can do with the info it gets from the interface.
It can also ask me to save any changes the user made (which is limited to the UI type of properties such as position, size, order, etc), so the user can customize his display.
ITypedList (which is used by most grids) is a good example with its GetItemProperties method, why can't PropertyGrid also use such a method iso Attributes ?
But displaying and maintaining properties is only the beginning. Why not include methods, which are then displayed as buttons (or context menus or some other wonderful thing). When the user
clicks on a button, the UI requests values for each parameter from the user (but only after requesting defaults, allowed values, help, etc for each parameter from the implementor of the interface).
This way, Reflection/Attributes represents only one of many ways to influence the UI. I can implement the interface such that the info is called from some config file or metadata database.
Is there something like that or am I missing something ?
|
|
|
|
|
Hello Nico,
sorry for the plug, but you seem to like the PropertyGrid but at the same time you regret it's not flexible enough at runtime. Did you try Smart PropertyGrid? It has been developed from scratch for flexibility and usability (this one, you can present it to your users)...
Let me know in the visualhint helpdesk if you have any question.
|
|
|
|
|
I am running into a weird situation right now. I have a UserControl that contains a MenuStrip. I want to hide certain items depending on the access level of the current user. When I set the top level menu item's Visible property to false...nothing happens and the item is still visible.
There are no references to any of the items anywhere else in the code so I am 100% sure that its not getting set back. If I set the Visible property to false via the designer...it works. Anyone ever encounter this or know whats going on??
|
|
|
|
|
In designer it's working?! Hmm and are you sure, if all of the controls on the menustrip should have Visible property = false ? [Menustrip have Controls property, which is collection of controls placed on that strip].
VirtualVoid.NET
|
|
|
|
|
|
i don't understand u'r question...but still is this what u want..
if(gridview.rows.count == st)
Message.show("Hello");
Koushik
|
|
|
|
|
Pish, editing you message as i type a reply.
My current favourite word is: Waffle
Cheese is still good though.
|
|
|
|
|
suppose st = 5;
i insert the row in gridview. I want to insert a according to variable suppose st=5; when gridview = st then appear message.
|
|
|
|
|
Why did you delete your original question? I didn't see it, so now I have no idea what you are talking about.
---
single minded; short sighted; long gone;
|
|
|
|
|
1) Is there any way of determining/measuring the extent of the floating point part of my computation (as a % of runtime)?
2) Also, is there any way what to determine what currently dominates in my application - (I/O) or compute?
I guess what I need are some sort of monitoring functions?
Cheers
|
|
|
|