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

Adding columns to a Table Codebehind?

1 Answer 126 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Apostol Apostolov
Top achievements
Rank 1
Apostol Apostolov asked on 15 Sep 2009, 07:20 AM
Hello,

I'm new to Telerik Reporting, I've benn working with it for a few days trying to make a specific report. So... my question - is there any way of adding columns to a table codebehind, not from the design view. Tere is no problem for generating rows from the datasource, but the thing is every time I call the report I'm giving it a different DataSet(Different columns and entirely different data) codebehind, so I cant know how many comumns are there going to be, so I cant assign the values and number of the columns at design view. I would appriciate any help.

Thanks, 
Apostol Apostolov

1 Answer, 1 is accepted

Sort by
0
Accepted
Steve
Telerik team
answered on 17 Sep 2009, 11:20 AM
Hi Apostol,

You can modify the table definition with code, in order to add/remove desired columns from it, but it is not that simple. You see, the Table / Crosstab report item is not a mere grid of cells and has a very complex internal structure. The Report Designer does a great deal of work to simplify common tasks, such as adding/removing a column from a table, but the underlying code is far from trivial to post or code easily in general. Could you, please, be more specific about what are you trying to accomplish? The easiest way to see an example code is to design the needed table layout in the report designer and then review the generated code in MyReport.designer.cs(vb) source file. Since you're changing the datasource everytime, the table's NeedDataSource is where you would need to use that code.

Kind regards,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
General Discussions
Asked by
Apostol Apostolov
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or