473,323 Members | 1,589 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

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<string, 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 6458
Hi John,

I am writing you with the assumtion that you know something about .NETs
TypeConverter or the ExpandableObjectConverter 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,...etc)

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<string, 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
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...
3
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...
0
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...
3
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...
3
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
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...
0
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...
1
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...
10
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
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.