PC Review


Reply
Thread Tools Rate Thread

Display array in PropertyGrid

 
 
Chris
Guest
Posts: n/a
 
      7th Dec 2009
I am trying to do something very simple in a PropertyGrid. I wish to
display an array. Here is my code.

public class GridObject
{
private double[] _vec = new double[] { 1.0, 2.0 };

[RefreshProperties(RefreshProperties.All)]
[EditorAttribute(typeof(ArrayEditor), typeof
(System.Drawing.Design.UITypeEditor))]
public double[] Vector
{
get { return this._vec; }
set { this._vec = value; }
}
}

The array displays fine and it seems that the CollectionEditor is
being used to edit the array. A couple of things I would like to
change:
a) The user should not be allowed to add or remove elements from the
array, i.e the array length should be unchanged.
b) Is there any way I can format the elements in the array. e.g 1.0
appears as 1. Can I have it appear as 1.0000?

Is there any way that this can be accomplished?

Thanks for any help in this matter. Regards

Chris
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PropertyGrid - how to display a string array as dropdown property Steve Microsoft C# .NET 4 15th Dec 2006 08:19 AM
How to display multi-dimensional array in PropertyGrid scott.ballard@gmail.com Microsoft Dot NET Framework Forms 0 8th Sep 2005 12:14 AM
array and propertygrid question Pol Bawin Microsoft C# .NET 4 15th Nov 2003 11:47 AM
Byte array in PropertyGrid Olav Langeland Microsoft VC .NET 0 13th Nov 2003 12:04 PM
PropertyGrid/CollectionEditor/Array sub-element ec Microsoft Dot NET Framework Forms 1 19th Sep 2003 04:14 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:07 PM.