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

How to design the Details Section of a group at the run time

3 Answers 89 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Utku Ozan
Top achievements
Rank 1
Utku Ozan asked on 10 Mar 2009, 11:07 AM
I am trying to create a report which will basically show data in groups. But the thing is that for each group the data to display might vary, both in columns and rows. This is why I can not design a Details Section at the Design-Time. While starting to process each group I am converting the necessary data while the groupHeader is being bound with:

private void groupHeaderSection4_ItemDataBound(object sender, EventArgs e) 
    Telerik.Reporting.Processing.GroupSection dtl = (Telerik.Reporting.Processing.GroupSection)sender; 
    sectionsData = ConvertToDataTable(dtl); 
which is OK. But after getting this re-constructed DataTable I want to design the Details Section of the Group according to the DataTable returned; which basically means to create columns and rows manually.

To create a custom grid on the fly I am trying to create TextBoxes and manually design them. This is where it gets stuck. I am doing this while binding data to the Details Section as:
private void detail_ItemDataBinding(object sender, EventArgs e) 
    Telerik.Reporting.Processing.DetailSection dtl = (Telerik.Reporting.Processing.DetailSection)sender; 
    dtl.Items.Clear(); 
    ProcessingBindColumnNames(dtl); 
 
protected void ProcessingBindColumnNames(Telerik.Reporting.Processing.DetailSection dtl) 
    double columnWidth = (double)(Convert.ToDouble(dtl.Width) - Convert.ToDouble(tbDurumWidth)) / (sectionsData.Columns.Count - 1); 
    tbColumnWidth = new Telerik.Reporting.Drawing.Unit(columnWidth, UnitType.Cm); 
    for (int c = 0; c < sectionsData.Columns.Count - 1; c++) 
    { 
        Telerik.Reporting.Processing.TextBox tb = new Telerik.Reporting.Processing.TextBox(); 
    } 
But at the line 14 I am getting "The Type 'Telerik.Reporting.Processing.TextBox' has no constructors defined".

How can I create a TextBox while binding the Group Details Section and why this item has no constructor but Intellisense brings me one when I type new?

Regards.

3 Answers, 1 is accepted

Sort by
0
Juzzer
Top achievements
Rank 2
answered on 11 Mar 2009, 04:42 PM
Try changing

Telerik.Reporting.Processing.TextBox tb = new Telerik.Reporting.Processing.TextBox();



to

Telerik.Reporting.TextBox tb = new Telerik.Reporting.TextBox();
0
Utku Ozan
Top achievements
Rank 1
answered on 12 Mar 2009, 07:43 AM
Of course I can create the TextBox from

    Telerik.Reporting.TextBox tb = new Telerik.Reporting.TextBox();

but this time after creating and formatting necessary controls I can not add them to the detailsSection which created from the type of

    Telerik.Reporting.Processing.DetailSection

As far as I can understand Telerik.Reporting.Processing objects can only interact with objects from the same class.
0
Accepted
Steve
Telerik team
answered on 12 Mar 2009, 05:05 PM
Hello Utku Ozan,

The very idea of creating processing items is not a good one and Telerik.Reporting.Processing.TextBox does not have a constructor as it's not meant to be used for creating items. As Juzzer suggested, you should work with the definition items.

Sincerely yours,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
Utku Ozan
Top achievements
Rank 1
Answers by
Juzzer
Top achievements
Rank 2
Utku Ozan
Top achievements
Rank 1
Steve
Telerik team
Share this question
or