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

RadPivotGrid

19 Answers 420 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
WM
Top achievements
Rank 1
WM asked on 08 Mar 2013, 04:59 PM
Is it possible to hide the expand/collapse arrow for certain RowFields?

Looking at the example, I want to disable and hide the expand/collapse button for that row where the value = "XXX"

Can i do this in the prerender event easily?

19 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 13 Mar 2013, 05:05 PM
Hi,

You can hide the expand button in PivotGridRowHeaderCell with text "XXXX" using the code snippet below:
protected void rpg_CellDataBound(object sender, PivotGridCellDataBoundEventArgs e)
  {
      {
          if (e.Cell is PivotGridRowHeaderCell)
          {
              if (e.Cell.Controls.Count>1 && (e.Cell.Controls[1] as Literal).Text == "XXXX")
              {
                  (e.Cell.Controls[0] as Button).Visible = false;
              }
          }
      }
  }

I hope this helps.

Greetings,
Pavlina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Menaka
Top achievements
Rank 1
answered on 14 Aug 2013, 01:09 PM
Hi,
  I have Rad Pivot grid. that grid 4 filter values there. I have drag and drop pull the field in filter box. i want which data i have to drag and drop in  the filter box. for example(rowheader filter, olumn header filter, aggregate filter, filter box).
 I need the answer for this. any body have answer means help me.
0
Prabu
Top achievements
Rank 1
answered on 16 Aug 2013, 06:55 AM
Hi Telerik Team

      I need to collect the data count which we drag and drop in aggregate field. how can we collect it.. any properties is there for those four fields, Aggregate, filter,Row,Column.
Thanks,
Prabu
0
Pavlina
Telerik team
answered on 19 Aug 2013, 07:22 PM
Hello Prabu,

Can you specify what do you mean by "data"? If you need an information about pivot grid fields you can use the code below:
RadPivotGrid1.Fields.Where(f => f is PivotGridRowField)

Thus you will be able to receive all row fields and using the same approach you can get all other fields.

Regards,
Pavlina
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Prabu
Top achievements
Rank 1
answered on 26 Aug 2013, 06:49 AM
Hi Pavlina,

   Here the data is Quantity in Aggregate Field so, Quantity is my data, if any field i drag and drop in aggregate filed i need to get that data.. so how its possible.

Thanks,
Prabu
0
Prabu
Top achievements
Rank 1
answered on 27 Aug 2013, 06:37 AM
 Hi Pavlina,

   Here the Data is Quantity in aggregate field. i need to store the data in a list that which data is belongs to which field. for example here i drag and drop the quantity in aggregate Field likewise category and Product name in Row field. so i need to store these data in a list. if i check with the list, i need to get these data.Is there any properties to implement this scenario. please advice


Thanks,
prabu
0
Pavlina
Telerik team
answered on 29 Aug 2013, 12:30 AM
Hello Prabu,

Did you try using the approach suggested in the previous post for getting the field data? You have access to the pivot grid's fields in the Fields collection of the controls. Therefrom you can retrieve any field you need by unique name or any other parameter using a linq query. Once you have the field you can store the data in a list and apply your custom logic in order to achieve your application requirements.

Regards,
Pavlina
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Prabu
Top achievements
Rank 1
answered on 04 Sep 2013, 07:21 AM
Hi Pavlina,

   
Thanks for your guide, I got all field details in a list and saved in database. need one more favor i have saved Many number  combination of field data collection in a database. i need to get the particular field collection data and rebind all the field details from database to radpivotgrid using some where condition . please advice

Thanks,
Prabu
0
Pavlina
Telerik team
answered on 09 Sep 2013, 09:36 PM
Hello,

May I ask you to open a support ticket and provide a sample runnable project which can help us to understand the logic of your application. Thus we would be able to advise you more accurately.

Thank you!

Regards,
Pavlina
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Prabu
Top achievements
Rank 1
answered on 12 Sep 2013, 07:47 AM
  Hi Telerik Team.

                      I have saved all field details(rowfield,FilterField,Columnfield,Aggregatefield)with selected data in a database. while i rebind it dynamically  from database to radpivotgrid fields . i am getting error " Multiple controls with the same ID 'id_Hidden' were found. FindControl requires that controls have unique IDs ".. pls advice how to rebind dynamically from database to radpivotgrid.

Thanks,
Prabu.
0
Pavlina
Telerik team
answered on 17 Sep 2013, 06:26 PM
Hello Prabu,

It is very likely that you get this error message because you have two different fields with the same UniqueName. The UniqueName should be different for each of the pivotgrid fields.

Regards,
Pavlina
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
KARTHIK
Top achievements
Rank 1
answered on 26 Jun 2015, 12:06 PM

Hi telerik Team,

  How to change the Aggregate function for specific rows .I am using rowsubtotals and using aggregate as sum for aggregate columns.but want some row subtotals calculated as average instead of sum.Please find the attached screen shot will show oil price is summed up instead of average.

 

For example :

 First 5 rows-subtotal have an aggregate as sum and the price rows need average aggregate.currently i am not able find any property or solution to calculate the average.please help any one have solution

below is aspx markup

 

<telerik:RadPivotGrid ID="RPG_Variance" AllowPaging="false" PageSize="10" Skin="Metro" Height="460px" RowGroupsDefaultExpanded="false" TotalsSettings-RowsSubTotalsPosition="First" RowTableLayout="Outline"
                           AccessibilitySettings-ColumnHeaderTableCaption="" TotalsSettings-ColumnGrandTotalsPosition="None" TotalsSettings-RowGrandTotalsPosition="None"
                           OnCellDataBound="RPG_Variance_CellDataBound" AllowFiltering="false" ShowFilterHeaderZone="false" OnNeedDataSource="RPG_Variance_NeedDataSource"
                           ShowDataHeaderZone="false" runat="server" ShowColumnHeaderZone="false">
                           <ClientSettings EnableFieldsDragDrop="false">
                               <Scrolling AllowVerticalScroll="true" ScrollHeight="460px" SaveScrollPosition="true"></Scrolling>
                           </ClientSettings>
                           <Fields>
                               <telerik:PivotGridRowField DataField="Category" CellStyle-Width="200px" SortOrder="None">
                               </telerik:PivotGridRowField>
                               <telerik:PivotGridRowField DataField="Budget" CellStyle-Width="200px" SortOrder="None" >
                               </telerik:PivotGridRowField>
                               <telerik:PivotGridColumnField DataField="MonthDate" CellStyle-Width="50px" SortOrder="None">
                               </telerik:PivotGridColumnField>
                               <telerik:PivotGridAggregateField DataField="Original" Aggregate="Sum" CellStyle-Width="90px"  
                                   DataFormatString="{0:N2}">
                                  
                               </telerik:PivotGridAggregateField>
                               <telerik:PivotGridAggregateField DataField="Scenario" Aggregate="Sum" CellStyle-Width="90px"
                                   DataFormatString="{0:N2}">
                                    
                               </telerik:PivotGridAggregateField>
                               <telerik:PivotGridAggregateField DataField="Variance" Aggregate="Sum" CellStyle-Width="90px"
                                   DataFormatString="{0:N2}">
                               </telerik:PivotGridAggregateField>
                               <telerik:PivotGridAggregateField DataField="Var" Aggregate="Sum" CellStyle-Width="90px"
                                   DataFormatString="{0:N2}%">
                               </telerik:PivotGridAggregateField>
                           </Fields>
                       </telerik:RadPivotGrid>

0
Pavlina
Telerik team
answered on 01 Jul 2015, 11:46 AM
Hi,

Custom Data Calculations functionality of RadPivotGrid will allow you to easily to accomplish the requirement that you have. An online demo which shows such calculations is available in the link below:
http://demos.telerik.com/aspnet-ajax/pivotgrid/examples/calculations/defaultcs.aspx?isNew=true

Regards,
Pavlina
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
KARTHIK
Top achievements
Rank 1
answered on 01 Jul 2015, 12:47 PM

Hi Pavlina,

       Thanks for your Response,

I tried  the custom data calculation demo provided above still am not able to achieve the functionality.if you provide the sample code 

snippet that will be help full.Below is the celldatabound event getting used.

Attached the screenshot explained the required scenario

 

protected void RPG_Variance_CellDataBound(object sender, PivotGridCellDataBoundEventArgs e)
       {
           if (e.Cell is PivotGridColumnHeaderCell)
           {
               PivotGridColumnHeaderCell cell = e.Cell as PivotGridColumnHeaderCell;
               cell.HorizontalAlign = HorizontalAlign.Center;
               cell.Wrap = true;
 
           }
           if (e.Cell is PivotGridColumnHeaderCell)
           {
 
               if (e.Cell.Text.Contains("Sum of "))
               {
                   e.Cell.Text = e.Cell.Text.Replace("Sum of ", "");
               }
           }
            
 
 
           if (e.Cell is PivotGridDataCell)
           {
               PivotGridDataCell cell = e.Cell as PivotGridDataCell;
               if (cell.CellType == PivotGridDataCellType.DataCell)
               {
                   if ((cell.Field as PivotGridAggregateField).DataField != "Var")
                   {
                       if (cell.ParentRowIndexes[0].ToString() == "Oil (Bbl)" || cell.ParentRowIndexes[0].ToString() == "Gas (Mcfd)" || cell.ParentRowIndexes[0].ToString() == "Liquids (Gal)")
                       {
 
                           e.Cell.Text = String.Format("{0:N0}", Double.Parse(e.Cell.Text.Replace("$", "")));
                       }
                       else if (cell.ParentRowIndexes[0].ToString() == "Oil Price $/bbl" || cell.ParentRowIndexes[0].ToString() == "Gas Price $/MCF" || cell.ParentRowIndexes[0].ToString() == "NGL Price $/Gal")
                       {
 
                           e.Cell.Style.Add("font-weight", "bold");
                           e.Cell.Text = "$" + String.Format("{0:N2}", Double.Parse(e.Cell.Text.Replace("$", "")));
                       }
                       
                       else if (cell.ParentRowIndexes[0].ToString() == "Average Oil Price $/bbl" || cell.ParentRowIndexes[0].ToString() == "Average Gas Price $/MCF" || cell.ParentRowIndexes[0].ToString() == "Average NGL Price $/GAL")
                       {
                           
                           e.Cell.Style.Add("font-weight", "bold");
                           e.Cell.Text = "$" + String.Format("{0:N2}", Double.Parse(e.Cell.Text.Replace("$", "")));
                       }
                       else
                       {
                           e.Cell.Text = "$" + String.Format("{0:N0}", Double.Parse(e.Cell.Text.Replace("$", "")));
                       }
                   }
               }
               
                
 
           }
           
       }

0
KARTHIK
Top achievements
Rank 1
answered on 02 Jul 2015, 12:34 PM

Hi Pavlina,

       Do you have any update on how to apply the Custom data calculations for specific rows.I tried the above link you provided its

not helping much.If you provide some code sample that will be help full.

Thanks

Karthik

 

 

0
KARTHIK
Top achievements
Rank 1
answered on 02 Jul 2015, 01:06 PM

Hi Pavlina ,

   Below is the code I tried for one row group using your custom data calculations link,

<telerik:RadPivotGrid ID="RPG_Variance" AllowPaging="false" PageSize="10" Skin="Metro" Height="525px" RowGroupsDefaultExpanded="false" TotalsSettings-RowsSubTotalsPosition="First" RowTableLayout="Outline"
                           AccessibilitySettings-ColumnHeaderTableCaption="" TotalsSettings-ColumnGrandTotalsPosition="None" TotalsSettings-RowGrandTotalsPosition="None"
                           OnCellDataBound="RPG_Variance_CellDataBound" AllowFiltering="false" ShowFilterHeaderZone="false" OnNeedDataSource="RPG_Variance_NeedDataSource" OnItemNeedCalculation="RPG_Variance_ItemNeedCalculation"
                           ShowDataHeaderZone="false" runat="server" ShowColumnHeaderZone="false">
                           <ClientSettings EnableFieldsDragDrop="false">
                               <Scrolling AllowVerticalScroll="true" ScrollHeight="525px" SaveScrollPosition="true"></Scrolling>
                           </ClientSettings>
                           <Fields>
                               <telerik:PivotGridRowField DataField="Category" CellStyle-Width="200px" SortOrder="None" CellStyle-Height="20px">
                                   <CalculatedItems>
                                       <telerik:PivotGridCalculatedItem
                                           GroupName="Oil Price $/bbl"></telerik:PivotGridCalculatedItem>
                                   </CalculatedItems>
                               </telerik:PivotGridRowField>
                               <telerik:PivotGridRowField DataField="Budget" CellStyle-Width="200px" SortOrder="None">
                               </telerik:PivotGridRowField>
                               <telerik:PivotGridColumnField DataField="MonthDate" CellStyle-Width="50px" SortOrder="None">
                               </telerik:PivotGridColumnField>
                               <telerik:PivotGridAggregateField DataField="Original" Aggregate="Sum" CellStyle-Width="90px" CellStyle-Height="20px"
                                   DataFormatString="{0:N2}">
                               </telerik:PivotGridAggregateField>
                               <telerik:PivotGridAggregateField DataField="Scenario" Aggregate="Sum" CellStyle-Width="90px" CellStyle-Height="20px"
                                   DataFormatString="{0:N2}">
                               </telerik:PivotGridAggregateField>
                               <telerik:PivotGridAggregateField DataField="Variance" Aggregate="Sum" CellStyle-Width="90px" CellStyle-Height="20px"
                                   DataFormatString="{0:N2}">
                               </telerik:PivotGridAggregateField>
                               <telerik:PivotGridAggregateField DataField="Var" Aggregate="Sum" CellStyle-Width="90px" CellStyle-Height="20px"
                                   DataFormatString="{0:N2}%">
                               </telerik:PivotGridAggregateField>
                           </Fields>
                       </telerik:RadPivotGrid>C#

0
Pavlina
Telerik team
answered on 06 Jul 2015, 01:31 PM
Hi,

Could you clarify if the attached code is working as you expected or you encounter any problems? If yes, what are they?

Regards,
Pavlina
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
KARTHIK
Top achievements
Rank 1
answered on 16 Jul 2015, 07:01 AM

Hi Pavlina.

       Attached code is not working as expected.Not able achieve the result with custom data calculations link.If you provide sample code that will be helpfull.

 

Thanks

Karthik.A

0
KARTHIK
Top achievements
Rank 1
answered on 16 Jul 2015, 07:04 AM

Hi Pavlina,

   Attached code is not working as expected.not able apply the custom data calculations for specific rows.If you provide some sample code that will be help full.

 

Thanks & regards

Karthik.A

Tags
PivotGrid
Asked by
WM
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Menaka
Top achievements
Rank 1
Prabu
Top achievements
Rank 1
KARTHIK
Top achievements
Rank 1
Share this question
or