We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridDataControl Sorting

Thread ID:

Created:

Updated:

Platform:

Replies:

91011 Oct 29,2009 01:31 PM UTC Dec 17,2009 05:45 AM UTC WPF 3
loading
Tags: GridControl
Thomas M
Asked On October 29, 2009 01:31 PM UTC

Hi,

How can i cancel the sorting in the GridDataControl on the Column header ? Can I override default sorting behavior?

Thanks in advance

Thomas M.

Ganesan K [Syncfusion]
Replied On October 29, 2009 01:58 PM UTC

Hi Thomas,

You can set the "AllowSort" property to false for cancelling the sort operation in the GridDataControl on the Column.

If you want to disable the sorting for all the visible columns then you can use the AllowSort property in "GridDataControl"

x:Name="dataGrid"
AutoPopulateColumns="True"
AutoPopulateRelations="False"
AllowSort="False" />

If you want to disable the sorting for a particular visible column then you can use AllowSort property in the "GridDataVisibleColumn"




Please let us know if you need any more details.

Thanks
Ganesan

Ezequiel Reyno
Replied On December 16, 2009 06:32 PM UTC

Hi,

I need to group by a fieldDisplayName but i need the groups to appear sorted by another field, fieldID.
FieldID will not be displayed in the columns.

How can i get this group/sorting behavior?

Thanks in advance,
Ezequiel.

Mohamed Suhaib Fahad A. [Syncfusion]
Replied On December 17, 2009 05:45 AM UTC

Hi Ezequiel,

Yes, this is possible. The default behavior of the grid when you drag and drop is that it will add a Sort Column automatically. So for your scenario, You can do it in some external event,

var view = this.dataGrid.Model.View;
using (view.DeferRefresh())
{
this.dataGrid.GroupedColumns.Add(new GridDataGroupColumn() { ColumnName = "ShipCountry" });
this.dataGrid.SortColumns.Add(new GridDataSortColumn() { ColumnName = "ShipCity" });
}

Add the appropriate Group & Sort column in the collections. I also have a sample uploaded in the below location,

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=sample910367894.zip

Thanks,
Fahad

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;