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

Merge columns programmatically

1 Answer 273 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Bert
Top achievements
Rank 1
Bert asked on 30 Sep 2016, 11:39 AM

Hello,

I am working on a report that should contains multiple tables with four columns. Each table is bound to a collection of the following data:
Class{
    public string item1 {get; set;}
    public string item2 {get; set;}
    public string Description1 {get; set;}
    public string Description2 {get; set;}

The cells of the first and second column should be merged when Item2 is an empty string. The same for the Description columns. I tried to adjust the TexBox sizes using the ItemDataBound events but this does not work. The column is rendered as wide as the largest text box.

The output should look like this:
Item1   Item2   Description1   Description2
Item11111111   Description11111111111111
Item1   Item2   Description1   Description2
Item1   Item2   Description1   Description2
Item11111111   Description11111111111111

Any help would be appreciated.
Regards,
Bert 

1 Answer, 1 is accepted

Sort by
0
Katia
Telerik team
answered on 04 Oct 2016, 01:54 PM
Hi Bert,

of the cells for a particular row is not supported. As the Table item is generated dynamically, when you merge two cells all the rows in the table will have those cells merged.

You can use bindings to change the BorderStyle of the cells dynamically. For example, when the data field is an empty string the BorderStyle can be changed to None which will imitate the merged cells. However, the text will remain in its original place.

I hope this approach will help.


Regards,
Katia
Telerik by Progress
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
Tags
General Discussions
Asked by
Bert
Top achievements
Rank 1
Answers by
Katia
Telerik team
Share this question
or