DataGridView.SortCompare not firing

0
0

I have a Datagridview and I defined SortCompare, but it’s not fireing at all. Is there any precondition to meet for that? Is there any sample where SortCompare is used?

  • You must to post comments
0
0

Thank you, it seems that Wisej objects stays compatible with winform ones.

So, if I want to interfere with sorting when datasource is set, I have to interfere on dataset sorting. Do you know how to do that?

  • You must to post comments
0
0

Hi Adrian,

There are a few preconditions for using the SortCompare event, you can find them here:

https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.datagridview.sortcompare?view=net-5.0

  • “This event occurs only when the DataSource property is not set and the VirtualMode property value is false.”
  • You must also set the ColumnSortMode to automatic.

Luca created a sample in this thread where SortCompare is used you can use for reference!

https://wisej.com/support/question/how-to-show-totals-for-datagridview

 

Let me know if it works for you!

 

Best,

Levie

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.