Checking the ValueSource of a RadProperty
|
Article relates to
|
RadControls for WinForms Q4 2006 SP2
|
|
Created by
|
Iordan Pavlov, Telerik
|
|
Last modified
|
February 2nd, 2007
|
|
Last modified by
|
Iordan Pavlov, Telerik
|
HOW-TO
Check the ValueSource of a RadProperty
SOLUTION
There are two ways for determining the current ValueSource for a RadProperty.
I. The easier way is to use the RadControlspy:
- Start RadControlspy (for example from the Examples application)

- Pick and drop the Target cursor on the desired control.
- Select an element from the element tree in the left.
- Right click on the property of interest in the property grid
- Click "Display Value Source Info" in the context menu

- A message box will pop up showing the current value source of the selected property
II. The second way to find the value of a property is by using code:
- Select the element of interest:
| RadElement borderElement = this.radButton1.RootElement.Children[0].Children[2]; |
- Select one of its properties:
| RadProperty radProperty = borderElement.GetRegisteredRadProperty("ForeColor"); |
- Get the value source for that property:
| ValueSource currentValueSource = borderElement.GetValueSource(radProperty); |
- Eventually show the value source:
| MessageBox.Show(string.Format("Value Source: {0}", currentValueSource.ToString())); |
| |
Comments
If you'd like to comment on this KB
article, please, send us a
Support Ticket.
Thank you!
Please
Sign In
to rate this article.