Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...