Blazor Pivot Table - Value Sort

Good Evening,
I've searched on the forum tryed a lot of combinations, and till now , not able to fix get this working.

I've a ViewValue 
 <PivotViewRow Name="XNAME" Caption="XName"  />
 <PivotViewValue Type="SummaryTypes.Sum" Name="ORDERS_PROD_QTD" Caption="Ordered Quantity" />
<PivotViewValue Type="SummaryTypes.Sum" Name="SALES_PROD_QTD" Caption="Sold Quantity" />

             
I'm trying to Sort by SALES_PROD_QTD and until now, i was only able to SORT by XNAME  


this is what i've tryed, and until now, didnt work.

<PivotViewSortSettings >
                    <PivotViewSortSetting Name="SALES_PROD_QTD" Order="Sorting.Ascending"  />
                </PivotViewSortSettings>
                <PivotViewValueSortSettings HeaderText="SALES_PROD_QTD#SALES_PROD_QTD" HeaderDelimiter="#" ></PivotViewValueSortSettings>


This works, the sort or its only manually ?

Best Regards,
Dionisio Luis

7 Replies 1 reply marked as answer

SN Sivamathi Natarajan Syncfusion Team September 8, 2020 11:12 AM UTC

Hi Dionisio, 
 
Thank you for using Syncfusion products. 
 
In your codes, you have set member sorting and value sorting in code-behind. But as per the behavior, at a time any one kind of sorting can be applied. In code-behind, member sorting has highest priority. So the declared value sorting won’t be reflected. So, we suggest you to set any one kind of sorting in code-behind and do other type of sorting in component UI. To enable both type of sorting in code behind, set “true” to “EnableSorting” and “EnableValueSorting” properties. For more information refer the UG, 
 
 
Regards,
Sivamathi. 



DL Dionisio Luis September 9, 2020 01:23 PM UTC

[1:38 PM] Sousa, João Pedro
Hi Sivamathi,
your answer is not very clear, but there is no sorting in the code-behind aside from what's in the pivot declaration. Take in account the following example:


<SfPivotView TValue="NewModel" AllowConditionalFormatting="true" ShowToolbar="true" Toolbar="@toolbar" EnableValueSorting="true">
    <PivotViewDataSourceSettings DataSource="@data" EnableSorting="true">
        <PivotViewRows>
            <PivotViewRow Name="NAME"></PivotViewRow>
        </PivotViewRows>
        <PivotViewValues>
            <PivotViewValue Name="QTT" Caption="Quantity"></PivotViewValue>
        </PivotViewValues>
        <PivotViewConditionalFormatSettings>
            <PivotViewConditionalFormatSetting Measure="QTT" Conditions=Condition.GreaterThan Value1=1000>
                <PivotViewStyle BackgroundColor="#80cbc4" Color="black" FontFamily="Tahoma" FontSize="12px">
                </PivotViewStyle>
            </PivotViewConditionalFormatSetting>
            <PivotViewConditionalFormatSetting Measure="QTT" Conditions=Condition.Between Value1=0 Value2=1000>
                <PivotViewStyle BackgroundColor="#f48fb1" Color="black" FontFamily="Tahoma" FontSize="12px">
                </PivotViewStyle>
            </PivotViewConditionalFormatSetting>
        </PivotViewConditionalFormatSettings>
        <PivotViewValueSortSettings HeaderText="QTT" SortOrder=Sorting.Descending></PivotViewValueSortSettings>
    </PivotViewDataSourceSettings>
</SfPivotView>

 

private class NewModel
{
    public string NAME { get; set; }
    public int QTT { get; set; }
}

 

private List<NewModel> data = Enumerable.Range(1, 75).Select(x => new NewModel()
{
    NAME = (new string[] { "ALFKI", "ANANTR", "ANTON", "BLONP", "BOLID" })[new Random().Next(5)],
    QTT = new Random().Next(100)
}).ToList();

 

public List<Syncfusion.Blazor.PivotView.ToolbarItems> toolbar = new List<Syncfusion.Blazor.PivotView.ToolbarItems> {
      Syncfusion.Blazor.PivotView.ToolbarItems.ConditionalFormatting
    };


Neither the sorting nor the conditional formatting are working, however, trying to sort or change the conditional formatting in the UI works well.


SN Sivamathi Natarajan Syncfusion Team September 11, 2020 09:40 AM UTC

Hi Dionisio,  
We are validating the reported problem in – “Soring” at our end. We will update the further details within two business days (9/14/2020).  
Regards,
Sivamathi. 
 



SN Sivamathi Natarajan Syncfusion Team September 15, 2020 02:41 PM UTC

Hi Dionisio, 
 
Thanks for the patience. 
 
We can able to reproduce the reported issues in latest update. But currently we are restructuring the component to speed up its performance. We will include the fixes in this implementation. And it will be available in Vol 3 release which is estimated to be rolled out on 30th September, 2020. 
 
We appreciate your patience until then. 
 
Regards, 
Sivamathi. 



DI Dionisio October 20, 2020 08:47 AM UTC

Good Morning,
We have updated to the latest build, and the Sort  still not working.
Any news about that ?


SN Sivamathi Natarajan Syncfusion Team October 21, 2020 09:38 AM UTC

Hi Dionisio, 
  
Sorry for the delay. 
  
Due to code complexity we are unable to complete the implementation in our 2020 Volume 3 release. But we will surely include this in our 2020 Volume 4 release which is estimated to be available in the mid of the December 2020. 
 
We appreciate your patience until then. 
 
Regards, 
Sivamathi. 



SS Saranya Sivan Syncfusion Team February 16, 2021 10:25 AM UTC

Hi Dionisio, 
  
We have fixed the reported issue in the weekly release (v18.4.0.43) nuget.org (https://www.nuget.org/). Meanwhile, we have prepared a sample for your reference. Kindly check the sample in the below link.  
  
  
Note: Kindly define the header text in the `ValueSortSettings` tag if the column fields are not defined in the data source settings. Please add the header text as follows, 
  
    <PivotViewValueSortSettings HeaderText="Grand Total##Sold Amount"  
    HeaderDelimiter="##" SortOrder=Sorting.Descending></PivotViewValueSortSettings> 
 
  
 Please let us know if you have concerns.  
  
Regards,  
Saranya.  
 


Marked as answer
Loader.
Up arrow icon