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

How and why does ItemType work in .net 4.5?

1 Answer 46 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Asti
Top achievements
Rank 1
Asti asked on 28 May 2013, 08:30 AM
Hi,

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? 

1 Answer, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 31 May 2013, 08:30 AM
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.

Regards,
Slav
Telerik
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.
Tags
General Discussions
Asked by
Asti
Top achievements
Rank 1
Answers by
Slav
Telerik team
Share this question
or