PivotGrid AggregateField Textbox Error

2 posts, 0 answers
  1. Syed
    Syed avatar
    36 posts
    Member since:
    Sep 2013

    Posted 10 Nov 2013 Link to this post

    Hi,
    In my telerik grid AggregateFiled,I have bind Text box.
    This works fine but when i click  on any button on page it shows me java script error message .
    i have attached Image for more details.
    if i replace Textbox with Lable its working fine.In my case i want to add text box to aggregate field and end user can edit the value and need to save the data.
    here is my code.

    By Code : Iam getting Error1.jpg
     TelerikPivotGridHelper.PivotGridAggregateFiled(RadGrid1, "", "LoadHours", "LoadHours", 60, "{0:F2}", "{0:F2}", TelerikControlType.TextBox, "lblAmount");

     #region PivotGridAggregateFiled
        public static void PivotGridAggregateFiled(RadPivotGrid grid, String headertext, String datafield, String UniqueName, int Width, String DataFormatString, String totalformatString, TelerikControlType Columntype, String contolID)
        {
            PivotGridAggregateField aggregateField = new PivotGridAggregateField();
            if (Columntype != TelerikControlType.None)
            {
                aggregateField.CellTemplate = new MyTemplate(datafield, Columntype.ToString(), Width - 2, contolID);
            }
            aggregateField.DataField = datafield;
            aggregateField.UniqueName = UniqueName;
            aggregateField.CellStyle.Width = Width;
            aggregateField.DataFormatString = DataFormatString;
            aggregateField.TotalFormatString = totalformatString;
            aggregateField.Caption = headertext;
            grid.Fields.Add(aggregateField);

        }
        #endregion



     public void txtbox1_DataBinding(object sender, EventArgs e)
            {
                TextBox txtbox1 = (TextBox)sender;
                PivotGridDataCell container = (PivotGridDataCell)txtbox1.NamingContainer;
                if (container.DataItem != null)
                {
                    txtbox1.Text = container.DataItem.ToString();
                }
                else
                {
                    txtbox1.Text = "0";
                }
            }

    by Design : Iam getting Error2.jpg
     <telerik:PivotGridAggregateField DataField="LoadHours"  CellStyle-Width="60px">
                    <celltemplate >   
                    <asp:TextBox ID='txtloadhours' runat="server" Width="46" Text='<%# Container.DataItem%>' ></asp:TextBox>
                    <%--  <asp:TextBox ID='txtloadhours' runat="server" Width="46" Text='<%# ProcessMyDataItem(Container.DataItem) %>' ></asp:TextBox>--%>

     
                      </celltemplate>         
                    </telerik:PivotGridAggregateField>   
  2. Syed
    Syed avatar
    36 posts
    Member since:
    Sep 2013

    Posted 10 Nov 2013 Link to this post

    Hi,
    i find the Solution ,its not due to Telrik Pivot grid,here iam adding many text box to the pivot grid for that in web.config.i add this line.Now its working fine.
     <appSettings>
        <add key="aspnet:MaxHttpCollectionKeys" value="10000" />
      </appSettings>
Back to Top