Adding TextBox to Processing.Panel

2 posts, 0 answers
  1. Michael Nagy
    Michael Nagy avatar
    18 posts
    Member since:
    May 2008

    Posted 01 Dec 2008 Link to this post

    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' "
  2. Steve
    Steve avatar
    10941 posts

    Posted 02 Dec 2008 Link to this post

    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,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top