Datagridview column order not staying static

Welcome to Wisej Support.
Questions, suggestions and plain old bugs - are all welcome here!
0
0

I am currently learning the differences from Visual Webgui to Wisej. One of my projects uses a large grid with approximately 60 columns. I created a very simple dataset with fields that would be used in the real application. I set the datasource of the grid to the dataset, no problem. The fun started when I created possibly more columns than the visible design surface. I expanded the grid in design view to accommodate. When I ran the application, the order of the columns changed to the design. I could then close the application and inspect the order of the columns, and no change. Is there a method to ensure columns are locked according to the original design.

  • You must to post comments
0
0

Hi John,

the bug number is WJ-7748 and a fix will be in the new release, published tomorrow.

Thanks
Frank

  • You must to post comments
0
0

Yep, the problem is the sorting by display index. When it’s  all -1 (the default), the order is scrambled since we use List<>.Sort() which uses quick sort which is an “unstable” sort  and items with identical values are not guaranteed to keep their order. My guess is that below a certain number quick sort is stable.

Anyway, it’s fixed in  the upcoming update.

Thanks,

Luca

 

  • John Sainsbury
    Thanks for that, I look forward to the next update. Hopefully it will not be too far away.
  • You must to post comments
0
0

After further investigation, if you have more than 16 columns, the order is mixed up. Remove columns and have no more than 16 and the order will stay correct.

  • You must to post comments
0
0

I just noticed the sample I sent saved the columns in the changed order. The correct order should be idcode, jobid, lastname, firstname, trade, mobile, airport etc. If you use the designer to change the order, it will revert back to a different order. This behavior only occurs once you have more columns than the visible grid.

  • You must to post comments
Showing 4 results
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Attachment
File Name Size
There are currently no files uploaded.
Maximum number of files 5, maximum file size 3.9MB.
Supported file formats: zip pdf gif jpg bmp png cs vb theme json