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

Feature request - SortExpression

2 Answers 57 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Barbaros Saglamtimur
Top achievements
Rank 1
Barbaros Saglamtimur asked on 25 Apr 2013, 12:00 PM
Is it possible to add SortExpression property? Like;
<telerik:PivotGridRowField DataField="ITEMNAME" Caption="Ürün Adı" UniqueName="ITEMNAME" ZoneIndex="4" SortExpression="ItemId">
</telerik:PivotGridRowField>

and default sort for the PivotGrid does not function if it does not binded to a DataField property.
For example; I did not bind ItemId to a RowField but would like to have default sort on that field. I think we need something like AdditionalDataFieldNames property.

<SortExpressions>
    <telerik:PivotGridSortExpression FieldName="ItemId" SortOrder="Ascending" />
</SortExpressions>

You know, RadGrid has this functionality.

PS:Attached screen shot shows my problem.

TIA

2 Answers, 1 is accepted

Sort by
0
Antonio Stoilkov
Telerik team
answered on 30 Apr 2013, 07:44 AM
Hello, 

The desired functionality could not be achieved because in order to sort a particular field it should be included in the data. The reason behind this is because the RadPivotGrid engine calculates based on the supplied data.

All the best,
Antonio Stoilkov
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
David
Top achievements
Rank 1
answered on 18 Jul 2013, 05:50 PM
I also needed to customize the sort of the Row Header.  Since I could not connect a field that contained the right sort sequence to the Row Header DataField, I included the sort sequence as the beginning character in the Row Header Value, then removed the sort sequence during PivotGrid_CellDataBound.
        protected void MyPivotGrid_CellDataBound(object sender, Telerik.Web.UI.PivotGridCellDataBoundEventArgs e)
        {
            // Format RowHeader Cell (custom sort cheat by including sort number in Measure field)
            if (e.Cell is PivotGridRowHeaderCell)
            {
                PivotGridRowHeaderCell cell = e.Cell as PivotGridRowHeaderCell;
                cell.Text = cell.Text.Remove(0, 2);
            }
}
Tags
PivotGrid
Asked by
Barbaros Saglamtimur
Top achievements
Rank 1
Answers by
Antonio Stoilkov
Telerik team
David
Top achievements
Rank 1
Share this question
or