This is a migrated thread and some comments may be shown as answers.

Apply border bottom to last row in a table field value

4 Answers 1199 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
sudo
Top achievements
Rank 1
sudo asked on 16 Jun 2018, 12:22 AM

I have a table that takes in an object data source which returns me back a list of objects that I populate the table row/columns with. 

In one of my row fields I have an expression like this Fields.Description which are grouped together so my table would look a little something like this:

 

---------------------------------------------------------

Col 1        Description

                Description1

                Description2

                Description3

Col 2        Description1

                Description2

                Description3

 

and so forth. I need to close the border at the bottom of the last Descriptions. Need some help getting started on how to apply the conditional formatting so that it will find out which is the data item on each row and then apply a border bottom on that to close the row off.

 

Thanks.

 

4 Answers, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 20 Jun 2018, 02:04 PM
His sudo,

You can use the built-in functions Count() and RowNumber() inside the scope of the Col group. If the count of the items in the group is equal to the current row number, this means you are positioned at the last row of the group where the bottom border should be.
Another option is to use just RowNumber() and if it is equal to 1, then you are positioned at the first row of the group and a top border can be applied.

In principle the approach is very similar to displaying reports with alternating style rows.

Regards,
Nasko
Progress Telerik
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 Feedback Portal and vote to affect the priority of the items
0
sudo
Top achievements
Rank 1
answered on 26 Jun 2018, 08:31 PM

Hi Nasko,

Thanks for the reply. I've tried the first way you've mentioned since I need to apply the border to bottom or else my very last row will have no border bottom as I've set border botton and to none. If I've set any border bottom then for every item in my column there will be a border at the bottom and that's not what I want.

I've tried setting a conditional format like so =Exec('colgroup', Count(Fields.Description)), Operator =, Value RowNumber() but I'm getting a Cannot perform operation on System.int32 and System.string.

0
Nasko
Telerik team
answered on 28 Jun 2018, 08:14 AM
Hi stanley,

The second expression returns string because it has not been evaluated. If you write just RowNumber() the string "RowNumber()" will be used for the comparison. To evaluate an expression use an equal sign in the beginning: = RowNumber()

Regards,
Nasko
Progress Telerik
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 Feedback Portal and vote to affect the priority of the items
0
sudo
Top achievements
Rank 1
answered on 10 Jul 2018, 06:22 PM
Thanks Nasko that worked perfectly.
Tags
General Discussions
Asked by
sudo
Top achievements
Rank 1
Answers by
Nasko
Telerik team
sudo
Top achievements
Rank 1
Share this question
or