lidds Posted June 6, 2005 Posted June 6, 2005 What I want to be able to do is add properties to my propertygrid at runtime depending on what properties the user has specified with a database table. Let me give you an example and hopefully it might all become clearer. I have a propertygrid called 'propGrid1' which is placed on my form already at design time. I then have a database table which has 3 columns and info as shown below: propertyName | propertyCategory | propertyType | ----------------------------------------------------- textProp1 | textCate | text | boolProp1 | booleanCate | boolean | What I want to be able to do is read the contents of the table and in this case create 2 properties within my propertygrid (1) name = 'textProp1' which is in a propertygrid category called 'textCate' which allows text input (2) name='boolProp1' which is in a propertygrid category called 'booleanCate' and allows a 'true' or 'false' combobox. I know how to hard code these properties in e.g. <CategoryAttribute("textCate"), _ DescriptionAttribute("Hard coded text property")> _ Public Property textProp1() As String Get Return _textValue End Get Set(ByVal Value As String) _textValue = Value End Set End Property But I don't know how to create a property dynamically using information from a table. Does anyone have any idea on how I could do this, I am relatively new to vb.net so any type of example would be greatfull. Thanks inadvance Simon Quote
Machaira Posted June 7, 2005 Posted June 7, 2005 See my reply to your previous post about the PropertyGrid control. Quote Here's what I'm up to.
pelikan Posted June 9, 2005 Posted June 9, 2005 thought about your problem - couldn't see an easy solution, so I googled it. check out - http://www.codeproject.com/cs/miscctrl/bending_property.asp Quote IN PARVUM MULTUM
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.