Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing Custom Control Property 1

Status
Not open for further replies.

meinhunna

Programmer
Jul 31, 2004
118
0
0
AU
How can I make a property change value of another property at design time? I have added HighlightRow property to custom DataGrid control. Now I want to assign this property similar to DataGrid’s ReadOnly property. For instance, when in property window ReadOnly property is set to True, the HighlightRow property should be set to true and vice-versa. I did something like this does not seems to work

Public Shadows Property [ReadOnly]() As Boolean
Get
Return m_blnReadOnly
End Get
Set(ByVal Value As Boolean)
m_blnReadOnly = Value

If Value Then
Me.HighlightRow = True
Else
Me.HighlightRow = False
End If

End Set
End Property

<Browsable(True), Description("Determines whether to highlight current row when ReadOnly property is set to True. By default set to False."), DefaultValue(False)> _
Public Property HighlightRow() As Boolean
Get
Return m_blnHighlightRow
End Get
Set(ByVal Value As Boolean)
m_blnHighlightRow = Value
End Set
End Property

Thanks
 
There is another attribute that you must add to your property definitions. I forget which one but my guess is something along the lines of RefreshAttribute or RefreshProperty Attribute.

Your assignment is probably working correctly, its just that the property page is not picking up the change and displaying it properly.

Check out the System.ComponentModel namespace:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top