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

Sort direction arrow in column header cell

I took the modified sort by column from the samples and modified it for my virtual grid. However, due to something unknown that I have done, the sort direction arrow on the column header 1) only shows on column 1, and 2) doesn't change when clicked. I have the data source sorting correctly, and the grid displays is correctly. Please check the enclosed file for the code. I've remove most of the extraneous code not applicable to this situation. Also, please explain what mechanism causes the arrow to show and how to change its indication. Thanks in advance, Jim Stewart

2 Replies

AD Administrator Syncfusion Team July 15, 2003 06:48 AM UTC

You said you removed some code from the file. Have you overridden OnSaveCellInfo? If so, are you setting e.Handled = true when e.RowIndex = 0. If you did, then the grid is not trying to save the values you set into the header cells. In particular, it will not be saving the Tag object that is used to handle the sorting header. This might explain the behavior you are seeing.

JS Jim Stewart July 15, 2003 12:02 PM UTC

Thinking that was extraneous, I did remove it. As it turns out, you caught it without even seeing it! Here's the old code: protected override void OnSaveCellInfo(GridSaveCellInfoEventArgs e) { if (m_AllowEdits && e.RowIndex > 0 && e.ColIndex > 0) { object data = m_Data[e.RowIndex - 1]; GridStyleInfo gridStyle = e.Style; m_CellInfo[e.ColIndex].SaveCellData (gridStyle, data); } e.Handled = true; } When I move the e.Handled into the if block, That takes care of it. Thanks so much.

Live Chat Icon For mobile
Up arrow icon