RadPivotGrid

20 posts, 0 answers
  1. WM
    WM avatar
    1 posts
    Member since:
    Nov 2011

    Posted 08 Mar 2013 Link to this post

    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?
  2. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 13 Mar 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Menaka
    Menaka avatar
    1 posts
    Member since:
    Aug 2013

    Posted 14 Aug 2013 Link to this post

    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.
  5. Prabu
    Prabu avatar
    6 posts
    Member since:
    Aug 2013

    Posted 16 Aug 2013 Link to this post

    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
  6. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 19 Aug 2013 Link to this post

    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.
  7. Prabu
    Prabu avatar
    6 posts
    Member since:
    Aug 2013

    Posted 26 Aug 2013 Link to this post

    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
  8. Prabu
    Prabu avatar
    6 posts
    Member since:
    Aug 2013

    Posted 27 Aug 2013 Link to this post

     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
  9. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 28 Aug 2013 Link to this post

    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.
  10. Prabu
    Prabu avatar
    6 posts
    Member since:
    Aug 2013

    Posted 04 Sep 2013 Link to this post

    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
  11. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 09 Sep 2013 Link to this post

    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.
  12. Prabu
    Prabu avatar
    6 posts
    Member since:
    Aug 2013

    Posted 12 Sep 2013 Link to this post

      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.
  13. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 17 Sep 2013 Link to this post

    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.
  14. KARTHIK
    KARTHIK avatar
    21 posts
    Member since:
    Oct 2013

    Posted 26 Jun 2015 Link to this post

    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>

  15. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 01 Jul 2015 Link to this post

    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
  16. KARTHIK
    KARTHIK avatar
    21 posts
    Member since:
    Oct 2013

    Posted 01 Jul 2015 in reply to Pavlina Link to this post

    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("$", "")));
                           }
                       }
                   }
                   
                    
     
               }
               
           }

  17. KARTHIK
    KARTHIK avatar
    21 posts
    Member since:
    Oct 2013

    Posted 02 Jul 2015 in reply to Pavlina Link to this post

    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

     

     

  18. KARTHIK
    KARTHIK avatar
    21 posts
    Member since:
    Oct 2013

    Posted 02 Jul 2015 in reply to Pavlina Link to this post

    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#

  19. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 06 Jul 2015 Link to this post

    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
  20. KARTHIK
    KARTHIK avatar
    21 posts
    Member since:
    Oct 2013

    Posted 16 Jul 2015 in reply to Pavlina Link to this post

    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

  21. KARTHIK
    KARTHIK avatar
    21 posts
    Member since:
    Oct 2013

    Posted 16 Jul 2015 in reply to Pavlina Link to this post

    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

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017