Unfortunately, there is no way to access datasource object for NewsList
. This certainly is a shortcoming for the control and will provide this ability for the next release.
If you want to set FilterExpression
property programmatically, you need to either inherit the control and override the property or wrap NewsList
in a User Control and set the property on some event such as Page_Load
. Then you have to add your derived control to the Toolbox
. Please see User Manual > Working with controls for reference on how to add controls to the Toolbox.
Additionally, if you want to implement your own control, you can use ContentManager to retrieve News articles:
|ContentManager manager = new ContentManager("News"); |
|manager.FilterExpression = "Author='John'"; |
|IList list = manager.GetContent(); |
The list will contain IContent
the Telerik team