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. Image for the cookie policy date
close icon

Custom GroupedColumns order

Hi,

On the grid grouping. I can easely add a group by doing this:

_grdDistributions.TableDescriptor.GroupedColumns.Add("BookName")

This group will be ordered by BookName.

Is there a way to order it by BookOrder instead?


5 Replies

NA Nisha Arockiya A Syncfusion Team February 23, 2009 12:09 PM UTC


Hi Stephane,

Thanks for your interest in Syncfusion Products.

GroupedColumns property gets the collection of SortColumnDescriptor objects defining group by state of the table. A SortColumnDescriptor defines the sort order or grouping of a table. SortColumnDescriptors are managed by the SortColumnDescriptorCollection which is returned by the SortedColumns or GroupedColumns property of a TableDescriptor. So the Groupedcolumns are ordered ascending/descending according to the column which it is grouped.

Please let me know if this helps.

Regards,
Nisha.



S_ Stephane _ February 23, 2009 03:26 PM UTC

I'm a bit confused.

Here's a small example. As you can see the books are ordered by their description "Book1, Book2, Book3, Book4".
What I'm looking for is to see them ordered by their ordernumber "Book4, Book2, Book3, Book1".

If I understand, the column Description must have some code that will make it order it self by Order instead of Description.
What I don't understand is where to put this code.

(I've added a screenshot and the code)



SortGrouping_6c87d0ee.zip


NA Nisha Arockiya A Syncfusion Team February 24, 2009 01:28 PM UTC

Hi Stephane,

Thanks for the Update.

Please refer to the following browser sample that suites your requirement.

\My Documents\Syncfusion\EssentialStudio\7.1.0.20\Windows\Grid.Grouping.Windows\Samples\2.0\Sort\Sort By Display Member Demo

This sample demonstrates a solution for sorting by display members of the foreign-key combo boxes instead of their value members.

Let me know if this helps.

Regards,
Nisha.



S_ Stephane _ February 25, 2009 03:38 PM UTC

For people interested. I was able to find the solution based on this post.

http://www.syncfusion.com/support/forums/Message.aspx?MessageID=26206

I created a group based on the OrderId but created a custom categorizer that displays the Description instead.

Dim cd As Syncfusion.Grouping.SortColumnDescriptor

cd = New Syncfusion.Grouping.SortColumnDescriptor()
cd.Name = "Order"
cd.Categorizer = New CustomCategorizer("Description")
Me.GridControl1.TableDescriptor.GroupedColumns.Add(cd)



NA Nisha Arockiya A Syncfusion Team February 26, 2009 08:44 AM UTC

Hi Stephane,

Thanks for sharing information with us.

Please let us know any other concerns.

Regards,
Nisha.


Loader.
Live Chat Icon For mobile
Up arrow icon