Hi,
since my update from Wisej 2.1.x.x to 2.2.9.0 automatic sorting by clicking on a header column seems not working.
Unfortunately I do not exactly know from which Wisej version this does not work anymore … but it has worked in all forms of my application so far and I have not made any changes within my code.
Best regards,
Harald
Thank you for the sample. It doesn’t work in Winform but it did work in previous builds of Wisej (prior to 2.1.88). It was changed in relation to this issue https://wisej.com/support/question/datagridview-and-sorting
Sorting a data-bound grid when the data source doesn’t support sorting is disabled in winforms. In Wisej it was done only if the data source was an IList and it obviously swapped the rows in the data source. I will log this as a regression.
Here is a simple Form, sorting by clicking the header columns worked well in previous wisej-versions but not in the current …
The code includes also a function “void Working()” that shows how it should look like, for this you have to call the function “void Working()” instead of “void NotWorking()” within the constructor of the form.
Cannot reproduce with 2.2.14. Please attach a small test case.
this bug still is not fixed until 2.2.14 (newest version)
unfortunately the sorting does not work in version 2.2.11 🙁
It’s fixed internally. We’ll update 2.2 tomorrow. The build also used a wrong revision.
It’s fixed internally. We’ll update 2.2 tomorrow. The build also used a wrong revision.
bs.DataSource = typeof(VM);
Is the definition of the data source. But when you populate the grid you must assign the actual data source to bs.DataSource. What kind of data source is it? DataTable, custom list, array?
the binding is like:
public class VM { int Id; … }
Wisej.Web.BindingSource bs = …;
…
bs.DataSource = typeof(VM);
dataGridViewTable.DataSource = bs;
…
There has been a fix/change related to this issue: https://wisej.com/support/question/datagridview-and-sorting
Is your DGV data bound and if yes, what is the data source type?