SharpGrid Support

Started by QWERTY1 at 07-08-2009 2:01 PM. Topic has 1 replies.

Print Search Rate
Sort Posts:    
   07-08-2009, 2:01 PM
QWERTY1 is not online. Last active: 7/9/2009 2:31:21 AM QWERTY1

Not Ranked
Joined on 12-01-2004
Posts 17
Grouping problem
I'm having a problem with grouping on sharpgrid version 1129. If there is no sortorder defined on a column before you drag to create a group, the group in messed up

put this in the form_load with a sharpgrid control and drag the first column to group it. you will see two "apple" heading rows (see attachment)
CODE 1:
sg.ColumnClickSort = True
sg.Rows.RemoveAll False
sg.Rows.Add sgFormatCharSeparatedValue, "apple,banana,orange"
sg.Rows.Add sgFormatCharSeparatedValue, "apple,pear,grape"
sg.Rows.Add sgFormatCharSeparatedValue, "apple,plum,kiwi"
sg.Rows.Add sgFormatCharSeparatedValue, "grapefruit,nectarine,berry"
sg.Rows.Add sgFormatCharSeparatedValue, "apple,guava,cherry"
Note: If you click the group header to sort, it groups properly


If the column is already sorted, or if you add a group through code and specify sorting, it works fine:
CODE 2:
sg.ColumnClickSort = True
sg.Rows.RemoveAll False
sg.Rows.Add sgFormatCharSeparatedValue, "apple,banana,orange"
sg.Rows.Add sgFormatCharSeparatedValue, "apple,pear,grape"
sg.Rows.Add sgFormatCharSeparatedValue, "apple,plum,kiwi"
sg.Rows.Add sgFormatCharSeparatedValue, "grapefruit,nectarine,berry"
sg.Rows.Add sgFormatCharSeparatedValue, "apple,guava,cherry"
sg.Groups.Add sg.Columns(1).ColIndex, sgSortAscending, sgSortTypeDefault


One workaround I found was to add some code to the
BeforeGroupChange() event
Private Sub sg_BeforeGroupChange(...)
    If Operation = sgGroupAdd Then
        If SortOrder = sgNoSorting Then
            SortOrder = sgSortAscending
        End If
    End If
End Sub

Is there another solution or option I am missing? I think the other version of the control automatically sorted when grouped.



   Report 
   07-08-2009, 8:58 PM
Andrey - DD is not online. Last active: 8/25/2011 5:42:49 PM Andrey - DD

Top 25 Posts
Joined on 08-01-2007
Russia, Novosibirsk
Posts 671

DDStaff
Re: Grouping problem
QWERTY1,

You are right. The workaround here is to apply sorting in BeforeGroupChange event.
We have Case 27139 about this problem you've described addressed to our
development staff and it is currently fixed in interim build. If you would like to get this build please contact us via e-mail sharpgrid.support@grapecity.us.com with your SharpGrid serial number.

Thank you,
Andrey T.
   Report 
GrapeCity » Product Support » SharpGrid Suppo... » Grouping problem

Privacy Policy | Copyright © 1997-2012 — GrapeCity, inc.
All trademarks mentioned are the property of their respective owners.