Check for last item in Text/XML Transfomation Kentico 7

Manorama Patil asked on February 6, 2018 15:45

Hi all,

Please help me on this.

I want to find out a last record in the repeater.I am using text/XML transformation. Below statement returns nothing. Please advice on how can I check for a last item in repeater. {% if(IsFirst()){"First Record"}else{"No"} %}

I am using Paging so DAtaItemIndex on each page strts from 0 and hence can't compare with DataItemCount. Please advice.

Recent Answers


Peter Mogilnitski answered on February 6, 2018 16:06 (last edited on December 10, 2019 02:31)

Normally with repeater you use ASCX transformation methods, but for Text / XML transformations, macro method equivalents with identical signatures are available for most transformation methods. You should try

{%if (IsLast()) {"Last Item"} else {"nope"} |(identity)GlobalAdministrator%}

0 votesVote for this answer Mark as a Correct answer

Manorama Patil answered on February 6, 2018 18:40

Thank You For the reply. I tried this it displays nothing. It shows a blank space.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.