Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > CMSRepeater query joined fields and OnItemDataBound View modes: 
User avatar
Member
Member
johnz - 5/5/2013 4:03:22 AM
   
CMSRepeater query joined fields and OnItemDataBound
Hi,

I have two questions related to the cmsrepeater based on below example:
<CMS:Repeater ID="Repeater" Path="/%" ClassNames="Custom.BaseMember;Custom.Event" WhereCondition=”year=1999”  OnItemDataBound="Repeater_DataBind runat="server" />

1. Is there an OnItemDataBound event in cmsrepeater ? I tried the OnItemDataBound event as in .net repeater but it doesn’t work.
protected void Repeater_DataBind(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
{
//code here was not reached.
}

2. Custom.BaseMember and Custom.Event are two customized document types. They have some common fields as well as distinct fields. I got an invalid column error when I tried to use the WhereCondition (as indicated in the example). I knew it’s because the “year” field only exist in Custom.Event. My question is how can I make the cmsrepeater be capable of querying joined fields in this case ?

Thanks & Regards

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 5/6/2013 1:47:40 AM
   
RE:CMSRepeater query joined fields and OnItemDataBound
Hi,

1. Have you tried using control instead of web part? <cms:CMSRepeater - this has the property and it is working fine.
2. You will need to use e.g. the repeater with custom query (where you will use your own query) or, add given field/column to all other document types.

CMSRepeater control documentation
QueryRepeater documentation

Best regards,
Juraj Ondrus