Display sort indicator icon in column header for custom sorting.

Posted by: jgebhardt on 10 September 2017, 10:58 am EST

  • Posted 10 September 2017, 10:58 am EST

    I would like to implement tri-state datagrid style sorting where I click on the column headers and the data is sorted by that column and an icon is rendered in the header to indicate the sort direction. I can achieve the sorting behavior by detecting clicks on the header row and sorting the underlying collection, but I have not figured out how to render an image in the header cell. I tried inheriting from Worksheet and overriding GetDrawingObject(int row, int column, int rowCount, int columnCount) but it only renders the data cells. How can I override the header cell rendering to include a custom icon/image?
  • Replied 10 September 2017, 10:58 am EST

    Hello,

    Please note that the response to you query has been made on the case id : 123507

    Request you to revert on the same to maintain the thread. Hereby, considering this forum as closed.

    Regards,
    Mohita
  • Replied 10 September 2017, 10:58 am EST

    While this works to customize the header cell template I'm noticing during horizontal scrolling that header cell is not always invalidated and repainted so an incorrect sort indicator is rendered on certain header cells. Is there a away to refresh only the header row during horizontal scrolling? Refreshing the entire grid will slow down scrolling too much.

    Below is the header template I'm using with a converter to hide/show the image of the sort indicator.
































  • Replied 10 September 2017, 10:59 am EST

    Hello,

    Apologies for the delayed response first of all. We are working on your issue and will get back to you with our observations on the same.

    Thanks,
    Reeva
  • Replied 10 September 2017, 10:59 am EST

    Hello,

    We could reproduce the issue with the attached demo, and the root reason is that it is caused by our cell recycle mechanism.

    Hence, our developers have already fixed this issue and the build for the same will be out in end of April in Spread Studio V9 SP 1 release.

    Thanks,
    Reeva
  • Replied 10 September 2017, 10:59 am EST

    Is Spread Studio V9 SP 1 available now for download?
  • Replied 10 September 2017, 10:59 am EST

    Hello,

    Not yet. We are expecting it to be out by this weekend. We will notify you once the build for the same will be out.

    Thanks,
    Reeva
  • Marked as Answer

    Replied 10 September 2017, 10:59 am EST

    Spread Studio v9 sp1 is now posted; you can download it here:
    http://spread.grapecity.com/downloads/

    Regards,
    -Sean
  • Replied 10 September 2017, 10:59 am EST

    Hello,

    Could you please share a small stripped out sample replicating the issue so that we can investigate this issue further at our end.

    And also specify exact steps to replicate along with Spread version used.

    Please share the same. We will look into this issue thereon.

    Thanks,
    Reeva
  • Replied 10 September 2017, 10:59 am EST

    Attached is a sample project that will allow binding some data to the spread grid. If you click on a column header you will see the data sort and an arrow indicator will be displayed indicating the sort direction. If you scroll to the right after sorting you will see another column show the sort indicator that hasn't been sorted. It seems like there is some UI control recycling happening in the header. If you scroll as far right as possible and then back to the left you will see the original sort column is no longer showing the sort indicator. The visibility of the indicator is controlled in a converter and if you place a break point in the converter it doesn't fire most of the time when scrolling back to the left.

    I'm using spread studio 9
    2016/04/SLSpread_CustomSortIndicator.zip
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels