How and why does ItemType work in .net 4.5?

2 posts, 0 answers
  1. Asti
    Asti avatar
    12 posts
    Member since:
    Dec 2007

    Posted 28 May 2013 Link to this post


    Not really a Telerik product specific question but you guys make some awesome controls and seems to have a deep insight into .net custom controls.

    In .net 4.5 the ItemType property was introduced which when specified provides intellisense/strongly typed access to the type which a data control is bound to. 

    Repeater - which interits from Control has this property, 

    I've tried to figure out how this mechanism works but all the tutorials and articles on this property only describe how to use it, not how to implement it in custom controls. 

    Maybe you guys could shed some light on this? 
  2. Slav
    Slav avatar
    1359 posts

    Posted 31 May 2013 Link to this post

    Hello Shamrez,

    Your custom control needs to inherit the class DataBoundControl in order to support strongly-typed binding and model binders. This will also give you access to the ItemType property for specifying the name of the data item type that will be used for the binding.

    I hope this helps. Feel free to contact us again if you run into more difficulties.

    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top