Checking the ValueSource of a RadProperty

Article Info

Rating: 5

 

Article information

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:
  1. Start RadControlspy (for example from the Examples application)
     

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

       
    4. 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:

  1. Select the element of interest:
     
    RadElement borderElement = this.radButton1.RootElement.Children[0].Children[2]; 

     
  2. Select one of its properties:
     
    RadProperty radProperty = borderElement.GetRegisteredRadProperty("ForeColor"); 

     
  3. Get the value source for that property:
     
    ValueSource currentValueSource = borderElement.GetValueSource(radProperty); 

     
  4. 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.