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

Adding TextBox to Processing.Panel

1 Answer 186 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Michael Nagy
Top achievements
Rank 2
Michael Nagy asked on 01 Dec 2008, 10:44 PM
hello all ,
i am using telerik Reporting service ..

i get panel from itemdatabound handler and i want to add dynamically textbox how can i do this ????

here is the MyPanel_ItemDataBound handller code
      void MyPanel_ItemDataBound(object sender, EventArgs e)
        {
                Processing.ReportItemBase itemBase = (sender as Processing.ReportItemBase).Parent;
                Processing.DetailSection section = (itemBase as Processing.DetailSection);
                Processing.ReportItemBase[] NetPanels = (Processing.ReportItemBase[])section.Items.Find("NetPanel", false);
                if (NetPanels.Length > 0)
                {
                Processing.Panel MyPanel = NetPanels[0] as Processing.Panel;
                Telerik.Reporting.TextBox labelCaption = new Telerik.Reporting.TextBox();
                labelCaption.Name = nestedData.Month.ToString() + "_" + EmployeeID.ToString();
                labelCaption.Value = nestedData.Month.ToString();
                labelCaption.Size = new SizeU(new Unit(40), new Unit(40));
                labelCaption.Location = new PointU(ChildLocation, new Unit(10));
                labelCaption.Style.BorderWidth.Bottom = new Unit(10, UnitType.Pixel);
                labelCaption.Style.BorderWidth.Top = new Unit(10, UnitType.Pixel);
                labelCaption.Style.BorderWidth.Right = new Unit(10, UnitType.Pixel);
                labelCaption.Style.BorderWidth.Left = new Unit(10, UnitType.Pixel);
                labelCaption.Style.BackgroundColor = Color.Black;
                labelCaption.Style.Color = Color.White;
                MyPanel,Items.Add(labelCaption); // compilation error here
"Error    103    Argument '1': cannot convert from     'Telerik.Reporting.TextBox' to 'Telerik.Reporting.Processing.ReportItemBase' "
            }
    }

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 02 Dec 2008, 04:42 PM
Hello Michael,

The report/report items event handlers are meant for altering the data and not for changing the report hierarchy. Also you should always work with Processing items when inside those.

Kind regards,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
Michael Nagy
Top achievements
Rank 2
Answers by
Steve
Telerik team
Share this question
or