This is a migrated thread and some comments may be shown as answers.

Better Control Overview

2 Answers 62 Views
Documentation and Tutorials
This is a migrated thread and some comments may be shown as answers.
Torben
Top achievements
Rank 1
Torben asked on 07 Dec 2012, 10:24 AM
Hello,
it would be great to have a Control Overview where you can get a List of all Controls which match a sepcific parameter.
For example i am currently searching for a List of Controls which have the "HtmlEncode" field.
(If somwhere exists such a list i would be thankfull if someone could post a link to that.)
So if someone needs an overview of Controls which match a criterion, that nobody else would think of he or she could just use that Site.

2 Answers, 1 is accepted

Sort by
0
Jeff Fritz
Top achievements
Rank 1
answered on 11 Dec 2012, 01:01 PM
If you already have a copy of the controls available, you can easily search across the collection of controls for properties or methods using reflection.

In a project that already references the controls libraries, you could use a method similar to the following:

public void InspectControlsForProperty(string propertyName = "HtmlEncode")
{
 
    var assembly = Assembly.GetAssembly(typeof(Telerik.Web.UI.RadGrid));
 
    var results = assembly.GetTypes().Where(t => t.GetProperty(propertyName) != null);
 
    foreach (var item in results)
    {
        Console.Out.WriteLine("Found {0} in: {1}", propertyName, item.FullName);
    }
 
}

Does this help?
0
Torben
Top achievements
Rank 1
answered on 12 Dec 2012, 03:17 PM
Yes, that does help.
Thank you very much :)
Tags
Documentation and Tutorials
Asked by
Torben
Top achievements
Rank 1
Answers by
Jeff Fritz
Top achievements
Rank 1
Torben
Top achievements
Rank 1
Share this question
or