Would like to have the ability to remove and add items to a pivot grid's filter window prior to rendering. Any item added or removed would be persisted/updated to the data-source. Many requests come from vendors that require certain information to be provided or removed based on user privileges, business rules, user inputs, etc..
Have a way to expand/collapse all within PivotGrid for each group level. It would be nice if the context menu (right click) would allow this.
PivotGrid: setting cell.CssClass to some class does not work for total cells but it does for data cells.
The code in the ASPx file is
<DataCellStyle CssClass="cfDataCell" Width="9%"/>
The expected output in the client browser is
<tr style="height: 35px;">
<td class="rpgDataCell cfDataCell" style="width:9%;">823</td>
<td class="rpgDataCell cfDataCell" style="width:9%;">2,488</td>
<td class="rpgDataCell cfDataCell" style="width:9%;">7,518</td>
<td class="rpgDataCell cfDataCell" style="width:9%;">10,851</td>
<td class="rpgDataCell cfDataCell" style="width:9%;">13,017</td>
<td class="rpgDataCell cfDataCell" style="width:9%;">13,069</td>
<td class="rpgDataCell cfDataCell" style="width:9%;">13,253</td>
<td class="rpgDataCell cfDataCell" style="width:9%;">12,799</td>
<td class="rpgDataCell cfDataCell" style="width:9%;">9,861</td>
<td class="rpgDataCell cfDataCell" style="width:9%;">4,543</td>
<td class="rpgDataCell cfDataCell" style="width:9%;">2,038</td>
<td class="rpgDataCell cfDataCell" style="width:9%;">592</td>
</tr>
However the generated Html is as below:
<tr style="height: 35px;">
<td class="rpgDataCell" style="width:9%;">823</td>
<td class="rpgDataCell" style="width:9%;">2,488</td>
<td class="rpgDataCell" style="width:9%;">7,518</td>
<td class="rpgDataCell" style="width:9%;">10,851</td>
<td class="rpgDataCell" style="width:9%;">13,017</td>
<td class="rpgDataCell" style="width:9%;">13,069</td>
<td class="rpgDataCell" style="width:9%;">13,253</td>
<td class="rpgDataCell" style="width:9%;">12,799</td>
<td class="rpgDataCell" style="width:9%;">9,861</td>
<td class="rpgDataCell" style="width:9%;">4,543</td>
<td class="rpgDataCell" style="width:9%;">2,038</td>
<td class="rpgDataCell" style="width:9%;">592</td>
</tr>
The RadGrid attachment shows the Data I need to present in the form of rows of Products each with a start date.
HOWEVER, I need to present the data "per start date" so basically the Date would be a Column Header, then each date would show the duration, start time, and price under each Start Date.
The PivotGrid attachment shows how I was able to take the same data and present it with the start date as a column but is not sufficient for my needs. I need to be able to Page by Start Date, so essentially a custom pager that keeps track of the Start Date and only shows like 3 days at a time. So in the screenshot you see Sept 9th through Sept 25, however I would like to have the pager control which rows are presented and then be able to page on the date column rather than showing the full month with a horizontal scrollbar.
When the EnableConfigurationPanel is enabled for the PivotGrid and is being rendered without having data bound to it, the "System.NullReferenceException: Object reference not set to an instance of an object." exception will be thrown.
To replicate the problem, add the following PivotGrid declaration to the page without binding data to it:
<telerik:RadPivotGrid ID="RadPivotGrid1" runat="server" EnableConfigurationPanel="true">
</telerik:RadPivotGrid>
When the scrolling is enabled and Skin set to Bootstrap, the rows are misaligned:
When defining more than 11 PivotGridColumnField(s), an error is thrown: "An item with the same key has already been added."
Set up to reproduce:
<telerik:RadPivotGrid ID="RadPivotGrid1" runat="server" EmptyValue="No data" AllowPaging="true" PageSize="10"
OnNeedDataSource="RadPivotGrid1_NeedDataSource">
<Fields>
<telerik:PivotGridRowField DataField="ShipCountry" UniqueName="ShipCountry">
</telerik:PivotGridRowField>
<telerik:PivotGridAggregateField DataField="Freight" UniqueName="Freight">
</telerik:PivotGridAggregateField>
<telerik:PivotGridColumnField DataField="ShipCountry1" UniqueName="ShipCountry1"></telerik:PivotGridColumnField>
<telerik:PivotGridColumnField DataField="ShipCountry2" UniqueName="ShipCountry2"></telerik:PivotGridColumnField>
<telerik:PivotGridColumnField DataField="ShipCountry3" UniqueName="ShipCountry3"></telerik:PivotGridColumnField>
<telerik:PivotGridColumnField DataField="ShipCountry4" UniqueName="ShipCountry4"></telerik:PivotGridColumnField>
<telerik:PivotGridColumnField DataField="ShipCountry5" UniqueName="ShipCountry5"></telerik:PivotGridColumnField>
<telerik:PivotGridColumnField DataField="ShipCountry6" UniqueName="ShipCountry6"></telerik:PivotGridColumnField>
<telerik:PivotGridColumnField DataField="ShipCountry7" UniqueName="ShipCountry7"></telerik:PivotGridColumnField>
<telerik:PivotGridColumnField DataField="ShipCountry8" UniqueName="ShipCountry8"></telerik:PivotGridColumnField>
<telerik:PivotGridColumnField DataField="ShipCountry9" UniqueName="ShipCountry9"></telerik:PivotGridColumnField>
<telerik:PivotGridColumnField DataField="ShipCountry10" UniqueName="ShipCountry10"></telerik:PivotGridColumnField>
<telerik:PivotGridColumnField DataField="ShipCountry11" UniqueName="ShipCountry11"></telerik:PivotGridColumnField>
<telerik:PivotGridColumnField DataField="ShipCountry12" UniqueName="ShipCountry12"></telerik:PivotGridColumnField>
</Fields>
</telerik:RadPivotGrid>
C#
protected void RadPivotGrid1_NeedDataSource(object sender, PivotGridNeedDataSourceEventArgs e)
{
(sender as RadPivotGrid).DataSource = OrdersTable();
}
private DataTable OrdersTable()
{
DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("OrderID", typeof(int)));
dt.Columns.Add(new DataColumn("OrderDate", typeof(DateTime)));
dt.Columns.Add(new DataColumn("Freight", typeof(decimal)));
dt.Columns.Add(new DataColumn("ShipCountry", typeof(string)));
dt.Columns.Add(new DataColumn("ShipCountry1", typeof(string)));
dt.Columns.Add(new DataColumn("ShipCountry2", typeof(string)));
dt.Columns.Add(new DataColumn("ShipCountry3", typeof(string)));
dt.Columns.Add(new DataColumn("ShipCountry4", typeof(string)));
dt.Columns.Add(new DataColumn("ShipCountry5", typeof(string)));
dt.Columns.Add(new DataColumn("ShipCountry6", typeof(string)));
dt.Columns.Add(new DataColumn("ShipCountry7", typeof(string)));
dt.Columns.Add(new DataColumn("ShipCountry8", typeof(string)));
dt.Columns.Add(new DataColumn("ShipCountry9", typeof(string)));
dt.Columns.Add(new DataColumn("ShipCountry10", typeof(string)));
dt.Columns.Add(new DataColumn("ShipCountry11", typeof(string)));
dt.Columns.Add(new DataColumn("ShipCountry12", typeof(string)));
dt.Columns.Add(new DataColumn("ShipCountry13", typeof(string)));
dt.Columns.Add(new DataColumn("ShipCountry14", typeof(string)));
dt.Columns.Add(new DataColumn("ShipCountry15", typeof(string)));
dt.Columns.Add(new DataColumn("ShipCountry16", typeof(string)));
dt.Columns.Add(new DataColumn("ShipCountry17", typeof(string)));
dt.Columns.Add(new DataColumn("ShipCountry18", typeof(string)));
dt.Columns.Add(new DataColumn("ShipCountry19", typeof(string)));
dt.Columns.Add(new DataColumn("ShipCountry20", typeof(string)));
dt.PrimaryKey = new DataColumn[] { dt.Columns["OrderID"] };
for (int i = 0; i < 70; i++)
{
int index = i + 1;
DataRow row = dt.NewRow();
row["OrderID"] = index;
row["OrderDate"] = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, 0).AddHours(index);
row["Freight"] = index * 0.1 + index * 0.01;
row["ShipCountry"] = "Country " + index;
row["ShipCountry1"] = "Country " + index;
row["ShipCountry2"] = "Country " + index;
row["ShipCountry3"] = "Country " + index;
row["ShipCountry4"] = "Country " + index;
row["ShipCountry5"] = "Country " + index;
row["ShipCountry6"] = "Country " + index;
row["ShipCountry7"] = "Country " + index;
row["ShipCountry8"] = "Country " + index;
row["ShipCountry9"] = "Country " + index;
row["ShipCountry10"] = "Country " + index;
row["ShipCountry11"] = "Country " + index;
row["ShipCountry12"] = "Country " + index;
row["ShipCountry13"] = "Country " + index;
row["ShipCountry14"] = "Country " + index;
row["ShipCountry15"] = "Country " + index;
row["ShipCountry16"] = "Country " + index;
row["ShipCountry17"] = "Country " + index;
row["ShipCountry18"] = "Country " + index;
row["ShipCountry19"] = "Country " + index;
row["ShipCountry20"] = "Country " + index;
dt.Rows.Add(row);
}
return dt;
}
Steps to reproduce:
Use the following live demo - https://demos.telerik.com/aspnet-ajax/pivotgrid/examples/olap/defaultcs.aspx
1. Open the filter dialog for the Year field residing in the ColumnFields and filter by selecting a single Year. (e.g. 2010)
2. Move the Year field to the Filter Fields and Update the Layout
As result, the 2010 filter is not applied anymore but opening the Filter Window keeps the same filter value still selected.
Demonstrating the issue in a basic sample - http://somup.com/c36ilGveZL
When try to expand inner group I get an error: System.InvalidOperationException: Sequence contains no elements. Stack trace: [InvalidOperationException: Sequence contains no elements] System.Linq.Enumerable.First(IEnumerable`1 source) +309 Telerik.Web.UI.RadPivotGrid.AddRemoveCollapsedGroupIndexBySlot(PivotGridGroupSlot groupSlot, BaseLayout layout, HashSet`1 indexes, Boolean defaultExpanded) +287 Telerik.Web.UI.RadPivotGrid.HandleExpandCollapse() +332 Telerik.Web.UI.RadPivotGrid.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) +484 System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +67 System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +123 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +33 System.Web.UI.WebControls.DataBoundControl.PerformSelect() +138 Telerik.Web.UI.RadPivotGrid.PerformSelect() +49 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +30 Telerik.Web.UI.RadPivotGrid.DataBind() +106 Telerik.Web.UI.PivotGridExpandCollapseEventArgs.ExecuteCommand(Object source) +727 Telerik.Web.UI.RadPivotGrid.OnBubbleEvent(Object source, EventArgs args) +205 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37 Telerik.Web.UI.PivotGridItem.OnBubbleEvent(Object source, EventArgs args) +121 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37 System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +114 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +159 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724 Note. This happens only whe I try to expand second level in group. ColumnGroupsDefaultExpanded and RowGroupsDefaultExpanded properties ot PivotGrid is set to "false" by default.