query repeater before content

lawrence whittemore asked on December 19, 2018 18:56

I have html in my before content in a query repeater, but was wondering if there was a way to change the content if the repeater only had 1 result vs many?

Correct Answer

Brenden Kehren answered on December 19, 2018 19:14

Remove the content from the before and after content boxes and add some logic in your transformation:

If(DataItemCount == 1) // do some work

Sometimes we'll use an <asp:PlaceHolder> and set the Visibility property to the above statement.

0 votesVote for this answer Unmark Correct answer

Recent Answers


lawrence whittemore answered on December 19, 2018 21:21

That will work I guess, I'll have to wrap it in a If(DataItemIndex==0) as well to only get it to show before the first item.

Thanks!

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on December 19, 2018 21:24

Depending on your version, IsFirst() and IsLast() work just like what you stated for checking the first item.

0 votesVote for this answer Mark as a Correct answer

lawrence whittemore answered on December 19, 2018 21:37

interesting, is there documentation on that?

0 votesVote for this answer Mark as a Correct answer

Harper George answered on December 24, 2018 18:36

Are you still getting any issues?

0 votesVote for this answer Mark as a Correct answer

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