Propertygrid - dynamic list loading. Example please

  • Thread starter Thread starter GrantS
  • Start date Start date
G

GrantS

I am needing to load a property grid with (string) values not known at
design.

All that is known at design is the category "Diagnosis facts".
The values populate the property grid will be acessed from an xml file
and in the medical world will differ for the type of medical area
involved. for instance Haematology might have:
Blood Type : with values to populate the list being
Type A
Type O
Type B

HDL : with values
null
1
2
3
4
5
.....

There would be more properties and their associated list of values to
select.
Another medical speciality would have a totally different set of
properties and values to select.

I have tried to extend the propertygrid example found on:
http://www.codeproject.com/vb/net/using_propertygrid.asp written by
Sreenivas where he uses the "States" list with hard coded States
values in a string array for the States class. I have also read Tony
Allowatt (http://www.codeproject.com/cs/miscctrl/bending_property.asp)
example but here he uses Enums with design time known values.

How can I extend the example of the States list to permit dynamic
loading of the values at runtime? If anyone has done this, please
could you post code snippets or if you know where there is an example
that could get me going, please post the url. I see that some postings
talk about using ICustomTypeDescriptor. I have had a try but no joy as
this is a bit above me right now. I have read the MSDN article by
Shawn Burke (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/vsnetpropbrow.asp.
So far nothing I have read makes sense enough for me to beat this. I
have seen a number of postings relating to this same issue but really
need a code example to work from.


Thanks in advance.

Grant
 
Back
Top