Data Resolvers

Posted by Community Admin on 03-Aug-2018 16:50

Data Resolvers

All Replies

Posted by Community Admin on 24-Nov-2010 00:00

Could someone explain how and when Data Resolvers are used (Settings -> Advanced -> Data -> Data Resolvers)?  My assumptions is that you they are applied to content prior to presentation so you can do some pre-processing of data.  The documentation is a little thin so any help is appreciated.

Posted by Community Admin on 24-Nov-2010 00:00

Hello Shawn,

DataResolver resolves data properties for data binding - in most of the case the DataResolver is used when we bind a control to a list of content items and we need to resolve the url of the single content item and set it to a NavigateUrl property of a HyperLink control. When you click on the link you will go to details mode and you will see the single content item.

sample

link.NavigateUrl = DataResolver.Resolve(ContentItemDataItem, "URL", host.UrlKeyPrefix, null);

For the resolver name you can use "URL" or "Author"

LabelControl.Text = DataResolver.Resolve(dataItem, "Author", someformat);


Sincerely yours,
Ivan Dimitrov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 24-Nov-2010 00:00

I would like to do some pre-processing of Content before it's displayed...specifically to html content entered in the RadEditor. Exactly like what Sitefinity does to resolve hyperlinks and images with Telerik.Sitefinity.Web.UI.Utilities.LinkParser class.  I would like to take specific datatags and transform them.  For example, I would like to look for occurrences of Year and display DateTime.Now.Year in its place.  Basically, I would like to wire in classes similar to the LinkParser class that performs some logic on html..replaces values, etc..  Is there a way to accomplish this via configuration? 

Posted by Community Admin on 24-Nov-2010 00:00

Hello Shawn,

The only way to do this is by creating a custom class that inherits from the control you want to modify and override some of its method where the content data is bound. You also have to modify the control template which represents the data.

If you want to do this for RadEditor control you should create a wrapper of the control similar to ContentBlok control.

All the best,
Ivan Dimitrov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed