473,545 Members | 2,663 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Advance Property Grid Manipulation

Hi all,

I'm trying to use a property grid, and what I'm trying to do seems to
really elude me. I've been using the property grid for a short period
of time, and this is the first thing I haven't been able to do.

I have some products... like t-shirts... and these products have
particular property / value pairs. I'd like the property grid to look
like this:

Category Clothing
Type T-Shirt
Properties
Color Purple
Material Cotton
Size XL

I'd even settle for something like:

Category Clothing
Type T-Shirt
Properties
Property
Name Color
Value Purple
Property
Name Material
Value Cotton

.... or...

Category Clothing
Type T-Shirt
Properties
[0]
Name Color
Value Purple
[1]
Name Material
Value Cotton

The problem is that I don't know the properties or the values. Both
are dynamic. That is that I have no idea what the properties (color
material size) or values (purple, cotton, xl) are. The product object
uses a SortedList<stri ng, string(i've also tried using arrays and
other structures) to store the key and value. And, additionally, I'd
like the value to be able to show a dropdown of all the possible
values for that key.

What I keep ending up with is something like:

Category Clothing
Type T-Shirt
Properties
Properties (Collection)

The collection brins up the collection editor, but I can't add or
change anything.

When I tried using arrays (and other structures), I ended up with
something like:

Category Clothing
Type T-Shirt
Properties
[0] Color
[1] Material
[2] Size

As you can see, neither of these is acceptable because it does not
give the user the desired editing capabilities of the above examples.
I've been using the MSDN article at
http://msdn.microsoft.com/library/de...ngpropgrid.asp
It has given me a really good starting point, but I just can't seem to
get any more out of the grid. Has anyone else attempted something
like this? Does anyone have any good examples or links?

Sincerely,

John Kraft
Aug 25 '06 #1
1 6472
Hi John,

I am writing you with the assumtion that you know something about .NETs
TypeConverter or the ExpandableObjec tConverter classes.

Personally, I haven't had the need for custom (dynamic)
properties/values as you described in your post, however, I found
several PropertyGrid articals on CodeProject.com where each example
implements different flavors of the PropertyGrid. I am about to post my
first artical/example with code snippets and credits of all
PropertyGrid articals combined. Stay tuned...it will be a more
advanced PropertyGrid with all the trimmings. (including- dynamic
properties, tabbing through GridItems, PropertySorting , dynamic code
generation,...e tc)

But since I havn't posted yet, here is (IMO) the best PropertyGrid
example that should get you in the direction you need to go.
http://www.codeproject.com/useritems/PropertyGridEx.asp

Cheers,
Greg Cadmes
John Kraft wrote:
Hi all,

I'm trying to use a property grid, and what I'm trying to do seems to
really elude me. I've been using the property grid for a short period
of time, and this is the first thing I haven't been able to do.

I have some products... like t-shirts... and these products have
particular property / value pairs. I'd like the property grid to look
like this:

Category Clothing
Type T-Shirt
Properties
Color Purple
Material Cotton
Size XL

I'd even settle for something like:

Category Clothing
Type T-Shirt
Properties
Property
Name Color
Value Purple
Property
Name Material
Value Cotton

... or...

Category Clothing
Type T-Shirt
Properties
[0]
Name Color
Value Purple
[1]
Name Material
Value Cotton

The problem is that I don't know the properties or the values. Both
are dynamic. That is that I have no idea what the properties (color
material size) or values (purple, cotton, xl) are. The product object
uses a SortedList<stri ng, string(i've also tried using arrays and
other structures) to store the key and value. And, additionally, I'd
like the value to be able to show a dropdown of all the possible
values for that key.

What I keep ending up with is something like:

Category Clothing
Type T-Shirt
Properties
Properties (Collection)

The collection brins up the collection editor, but I can't add or
change anything.

When I tried using arrays (and other structures), I ended up with
something like:

Category Clothing
Type T-Shirt
Properties
[0] Color
[1] Material
[2] Size

As you can see, neither of these is acceptable because it does not
give the user the desired editing capabilities of the above examples.
I've been using the MSDN article at
http://msdn.microsoft.com/library/de...ngpropgrid.asp
It has given me a really good starting point, but I just can't seem to
get any more out of the grid. Has anyone else attempted something
like this? Does anyone have any good examples or links?

Sincerely,

John Kraft
Aug 26 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1113
by: Andreas Poller | last post by:
Hi, I want to customize a Property Grid in the following way: The Property Grid should show a property which value should be changed by a dropdown-listbox. For example, there is a property called "animal" and when I want to change the value of the property in the property grid it should show me a dropdown-box with standard values like...
3
2089
by: Dave | last post by:
I would like to create an application which gives the user a grid type interface for input, but is not connected to a database. I would save the grid contents to an array for manipulation. Is there a way to do this with the grid that comes with VB.Net? (a pointer to any examples would be GREATLY appreciated!) Dave
0
5552
by: Brian Young | last post by:
Hi all. I'm using the Property Grid control in a control to manage a windows service we have developed here. The windows service runs a set of other jobs that need to be managed. The control is used to view the state of the running jobs and schedule new jobs. The control also runs in the context of Internet Explorer (we do this so the...
3
1780
by: Nice Chap | last post by:
Is it possible to have custom property pages for a Component and if so how I can write one please ? Also, is it possible to reuse the drop down box that we get for Data Source and Data Member inside VS.net's property grid, for my component ? If so any pointers would be immensely appreciated. Thank you.
3
11286
by: Steve Teeples | last post by:
I was wondering if there is a way to force a property within a property grid to update and then display a modified value when when a second property (true/false) is toggled? -- Steve
2
2684
by: Ray Cassick | last post by:
I am looking for a way to hide a property I created on a user control from a property grid at runtime but allow it to be seen at design time. Any ideas? I tried setting the category of the property to 'Design' and that does not do it. I tried adding the 'DesignOnly' attribute and that does not do it.
0
1502
by: Hans Koller | last post by:
Hello group, I design a class to bind it to a property grid for easy modification of some settings. My problem is now that I want to raise an event when a settings has been changed. Thats not a problem with some "normal" properties (see property DisplayGrid). But when I use a subclass and TypeConverter the setter of the property is not...
1
4369
by: asharda | last post by:
I have a custom property grid. I am using custom property grid as I do not want the error messages that the propertygrid shows when abphabets are entered in interger fields. The custom property grid doesn't show colloections i.e. if I have a List<Objectthen the Collection is shown but when I click on the "..." button next to it nothing...
10
10002
by: Derek Hart | last post by:
I can set focus to my property grid by using propgrid.Focus - but how can I set the default property that is always first? Or just set focus to the default property? Can this be done?
0
7425
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7449
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7780
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5351
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5069
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3479
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1911
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1037
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
734
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.