PiousVenom
PiousVenom

Reputation: 6908

Grouping items in telerik reporting

I'm trying to use grouping in the Telerik reporting so that I display a certain value only once. Here's what I'm going for:

enter image description here

And here's what I'm getting:

enter image description here

I've tried just about everything I could think of with the grouping. I've moved the Name to the group header, I've moved it all to the group header. Just nothing seems to be going my way with this. Is there a way to actually achieve what I'm trying to do?

Upvotes: 1

Views: 1493

Answers (1)

Joe
Joe

Reputation: 5487

I don't know of a built in way to do this, but you can achieve it with a small amount of code.

If you switch from the designer to code view

 private static string LastValue { get; set; }

 public static string SuppressDuplicates(string value)
 {
    if (LastValue == value) return string.Empty;
    LastValue = value;
    return value;
}

And then on the designer change your text box from =Fields.FirstName to '= ReportLibrary.ReportName.SuppressDuplicates(Fields.FirstName) via the expression editor.

It would also be possible to achieve the same thing by adding a handler to the items DataBound event.

Upvotes: 1

Related Questions