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

multiple column sorting

Hi, Im implementing multiple column sorting in the GDBG, and need to modify the header cell renderer that renders the little up/down triangles. I''m going to be rendering numbered up/down triangles instead. I cant for the life of me find where the up/down triangle is rendered. Where would be best place to override this behaviour be found. Ideally, instead of assigning a ListSortDirection to the Column.StyleInfo.Tag, I would like to assign a class that comprises a ListSortDirection and a number indication sort priority.

3 Replies

AD Administrator Syncfusion Team March 25, 2004 05:35 PM

That sort indicator is drawn as GridSortColumnHeaderCellRenderer.Draw. The sort header is a celltype. The GridDataBoundGrid has code to add a ColumnHeaderCell celltype. model.CellModels.Add("ColumnHeaderCell", new GridSortColumnHeaderCellModel(model)); To handle drawing s special sort header, you can derive a custom cell control and handle it that way. Or, you could try catching the CellDrawn event, and if the cell being drawn is a ColumnHeaderCell, then draw the extra character over what is drawn by default. This sendond alternative does not require creating your own cell control.


AD Administrator Syncfusion Team March 26, 2004 10:20 AM

Im going down the road of writing my own cell renderer. I want to intercept the click event that normally gets routed to the GDBG sort method. I am going to need richer click events, such as control-double-click causing a column to be added to the collection of sorted columns. What click handler is used to route double-click events to the GDBG sort method?


AD Administrator Syncfusion Team March 26, 2004 10:30 AM

The GridDataBoundGrid.OnCellDoubleClick is where the sorting is called when you are using double click sorting. If you want to handle your own sorting, you can catch the CellDoubleClick event, do your sort, and set e.Cancel = true to prevent the grid''s default sorting from taking place. See the \Essential Suite\2.0.3.0\Grid\Samples\DataBound\DataBoundSortByDisplayMember for a use case.

Loader.
Live Chat Icon For mobile
Up arrow icon