Hi,
When i add a field programmatically:
Button1_Click:
when i interact with him, it raises an error:
Uncaught Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: Value cannot be null.
Parameter name: fieldInfo
what is the issue ?
sorry my poor english.
When i add a field programmatically:
Button1_Click:
PivotGridColumnField _row = new PivotGridColumnField();_row.DataField = "[Account].[Accounts]";_row.UniqueName = "[Account].[Accounts]";this.RadPivotGrid1.Fields.Add(_row);when i interact with him, it raises an error:
Uncaught Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: Value cannot be null.
Parameter name: fieldInfo
what is the issue ?
sorry my poor english.
5 Answers, 1 is accepted
0
Hello Alef,
Could you please confirm that you add the field into the PageInit event or in PageLoad event as is described into the following documentation article:
http://www.telerik.com/help/aspnet-ajax/pivotgrid-programmatic-creation.html
Additionally it will be helpful if you could post your aspx markup with the related code behind code.
Thus we will be able to gather more details about your scenario and provide you with more to-the-point answer.
Looking forward for your reply.
Regards,
Radoslav
Telerik
Could you please confirm that you add the field into the PageInit event or in PageLoad event as is described into the following documentation article:
http://www.telerik.com/help/aspnet-ajax/pivotgrid-programmatic-creation.html
Additionally it will be helpful if you could post your aspx markup with the related code behind code.
Thus we will be able to gather more details about your scenario and provide you with more to-the-point answer.
Looking forward for your reply.
Regards,
Radoslav
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
AlefSan
Top achievements
Rank 1
answered on 19 May 2014, 01:16 PM
Radoslav,
I wanna add fields on Button Event Click .
I have a Save Button that saves the fields that I added in xml file.
And I have a Load Button that loads the xml file adding the fields on own places.
ASPX:
Code behind:
Thanks.
I wanna add fields on Button Event Click .
I have a Save Button that saves the fields that I added in xml file.
And I have a Load Button that loads the xml file adding the fields on own places.
ASPX:
<telerik:RadScriptManager runat="server" ID="RadScriptManager1" /> <telerik:RadAjaxManager runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RadPivotGrid1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadPivotGrid1" LoadingPanelID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> .................... <td class="tdImage"> <asp:ImageButton ID="btnOpenCube" runat="server" ImageUrl="~/bsiImages/cube_16x16.png" OnClick="btnOpenCube_Click" /></td> <td class="tdImage"> <asp:ImageButton ID="btnOpenVis" runat="server" ImageUrl="~/bsiImages/abrir_visao_16x16.png" OnClick="btnOpenVis_Click" /></td> .............. <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default"> </telerik:RadAjaxLoadingPanel> <asp:Panel runat="server" ID="pnlPivot"> <telerik:RadPivotGrid ID="RadPivotGrid1" runat="server" AllowFiltering="true" AllowSorting="true" RowTableLayout="Tabular" FieldsPopupSettings-AggregateFieldsMinCount="2" AllowPaging="true" PageSize="20" EnableZoneContextMenu="true" OnPivotGridCellExporting="RadPivotGrid1_PivotGridCellExporting" AggregatesPosition="Rows"> <ConfigurationPanelSettings Position="Left" LayoutType="OneByFour" DefaultDeferedLayoutUpdate="false" /> <PagerStyle AlwaysVisible="true" /> </telerik:RadPivotGrid> </asp:Panel>Code behind:
protected void btnSaveVis_Click(object sender, ImageClickEventArgs e){ Visao.fields = new List<PivotGridField>(); foreach (PivotGridField i in this.RadPivotGrid1.Fields) Visao.fields.Add(i); Visao.makeXml(); //Filtros //foreach (PivotGridOlapLabelGroupFilter i in this.RadPivotGrid1.Filters) // foreach (MemberDistinctValue x in ((((i.GetDataEngineFilter()) as OlapLabelGroupFilter).Condition) as OlapSetCondition).Items) // x.GetType}protected void btnOpenVis_Click(object sender, ImageClickEventArgs e){ Visao.loadXml(); foreach (PivotGridField i in Visao.fields) this.RadPivotGrid1.Fields.Add(i); //this.RadPivotGrid1.DataBind(); //PivotGridRowField _row = new PivotGridRowField(); //this.RadPivotGrid1.Fields.Add(_row); //_row.DataField = "[Account].[Accounts]"; //_row.UniqueName = "[Account].[Accounts]"; //this.RadPivotGrid1.DataBind();}Thanks.
0
Hi Alef,
Unfortunately adding filed into the PivotGrid control on button click is not supported scenario. However you can load the fields on PageInit by using following code snippet:
Please give it try and let me know if it helps you. Looking forward for your reply.
Regards,
Radoslav
Telerik
Unfortunately adding filed into the PivotGrid control on button click is not supported scenario. However you can load the fields on PageInit by using following code snippet:
protected override void OnInit(EventArgs e) { base.OnInit(e); if (Request.Form.Get("ButtonLoadFieldsID") != null) { // create pivot and load fields } }Please give it try and let me know if it helps you. Looking forward for your reply.
Regards,
Radoslav
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
AlefSan
Top achievements
Rank 1
answered on 20 May 2014, 12:50 PM
I understood.
I will try.
Thanks.
I will try.
Thanks.
0
AlefSan
Top achievements
Rank 1
answered on 02 Jun 2014, 07:07 PM
Hi,
On Init everything occurred ok !
Thanks a lot.
On Init everything occurred ok !
Thanks a lot.
