If I have an empty DataGridView and I click on a header it causes an application error.
This then breaks the application.
See attached screen shot.
If I set AllowSortingDatasource to False it gets rid of the error, however the sort arrow still shows
I am using version 2.2.29.0
Those are different headers. The row headers is basically a column in a panel since it doesn’t scroll horizontally. The grid is composed of panes. The pane at 0 is the row headers, the pane at 1 is the scrollable columns. When you have frozen columns the scrollable pane becomes 2 and you have 3 panes, 0=row headers, 1=frozen columns, 2=the rest. Each pane has a container at the top for the column headers which contains the headers (which are widgets, like a button) on a HBox layout. If any of the widgets increases in size it makes the parent container grow to fit the widget, so it will also stretch the other widgets in the same container. Otherwise they would get truncated.
When you set the column header height, the js code will set the height to all the header containers in all the panes, but it doesn’t listen to the size changes coming from “inside”. Which probably it should…
The gdi scaling is done by the browser. Since wisej icons in our themes are all svg they will scale without losing resolution.
The sort icon is at “table-header-cell/sort-icon”. If you click on it in the ThemeBuilder it will select it and at the bottom in the status bar it will show the path to the component. It will also scroll the source code in the editor to the correct location. See attached screens, I changed the icon to 10px.
For a bound DataGridView with a combo box column the solution for sorting is to:
This gives the illusion that you are actually sorting the combo box column
The sorting also is not a bug. The only value in the cell is the key when the combo box has a ValueMember and a DisplayMember. The display value can change at any time. In fact winforms (attached) sorts the same way. And it’s also the same way the database would sort it since the display value is just a lookup. You can implement or change the sorting by attaching to DataGridView.SortCompare or by using Sort(IComparer).
HTH
Hi Frank
Thanks how do you explain the image I uploaded earlier showing that the column header height had increased when the grid contained rows, but not the height of the blank header column above the row header? I can’t understand why this is happening.
Is the gdi scaling out of sync with that required by the control?
How would I use the theme to fix this
Thanks for your help
Ewan
Hi Ewan,
AllowSortingDatasource = false allows you to implement your own sorting if the data source doesn’t support it and you don’t want wisej to sort it for you. Showing the sort order is correct. It’s the same as SortMode.Programmatic. The sort glyph is displayed, the SortedColumn and SortOrder properties are updated, but the actual sorting is up to the program. Otherwise set it to NotSortable.
The original error you report has been fixed. It’s in the latest dev build but it turns out the dev build has other issues unrelated to this so I’d wait for the release build.
The sort glyphs as all icons in wisej scale with the browser and gdi scaling, not the control. To scale the icon you can use the theme. Otherwise a tall column header would have an impossibly scaled icon. All grids I have tried do the same
> If I sort a combo box column the key is sorted not the display data.
That’s a bug. Thanks!
Hi Frank
Using 2.2.33 I notice the following:
I have set the column header height to 25 and would have expected the sort arrows to scale.
Thanks for you help
Ewan
Hi Ewan,
issue #2536 is fixed in our latest Wisej development build (2.2.33).
Best regards
Frank
Hi Ewan,
We’re able to reproduce the issue, I’ve logged it as issue #2536. It should be fixed for the next build. I’ll keep you updated!
Best,
Levie
Hi Ewan,
I’m having trouble reproducing the issue. Could you please attach a sample project?
Best,
Levie
Please login first to submit.