I have tried the ff:
bs.RemoveCurrent();
dataGridView1.Refresh();
Is this the new behavior?
Thanks.
Hi, any update on this?
This exception has been temporarily handled with you provided solution, and we look forward to product updates.
Thanks again!
Confirmed to be a bug. Logged as bug #2450
The quick workaround is to add
FindPage().ActiveControl = null;
// or
FindForm().ActiveControl = null;
before setting the data source.
1- There isn’t much to detect. A PWA is simply a web page that may or may not be loaded from local cache. The cache is managed by a service worker. There is nothing more to it. Chrome allows the page to be “installed”, but it’s still just a link. There is some javascript that you can try to detect of the page is standalone.
2- No Wisej is server side only. Wasm and PWA are two different things. Wasm is webassembly and in .NET case it’s mono loaded in the browser. PWA isa way to save requests/responses in a local cache. You can add any client code in the /Offline folder but it cannot use the server or the database when offline.
Does it happen when the session is abandoned? If that’s the case then it’s normal. The thread is aborted or you end up executing the code after the dialog. You have to be careful when catching the exception and check for ThreadAbortException in case you are executing code.
In .NET there is a special exception called ThreadAbortException that can be caught but cannot escape the try/catch block (the code outside will never be executed even if you catch the exception). And it cannot be thrown, it’s raised by Thread.Abort(). It is designed to more or less gracefully abort a thread.
In ASP.NET it’s fired hundreds of times when using Transfer or response.End(). You may read some blogs telling you that it shouldn’t be used. They just don’t know how threading works.
Hi Wilfred,
we had to refine the fix for #2412 making that behavior the non default behavior because it caused some other issues.
The next Wisej build will include a new property AllowSortingDataSource (default = true) that you can set to false
to get the desired behavior.
I will inform you when the new build is available.
Best regards
Frank
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.
Hi Cristian,
Could you explain a bit more what you’re trying to accomplish? You can prevent the keyboard from appearing by setting read-only to true (you can check if it’s a mobile device using Application.Browser).
Best,
Levie
Thank you. This is fixed in our internal build.
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.
ok Luca,
I do a test project, you are right, for some reason the problem it is only in my project.
thank you
Cristian
Hi Antonio,
The Wisej mobile integration package is currently available to Technology Partners (https://wisej.com/technology-partner/) as part of their membership.
We’re still working out the details of a new licensing model that will include some new cool products like the mobile integration package.
Until then you can contact us privately at sales AT wisej dot com if you’re interested in getting started with it!
Best regards,
Levie
Tried this as a temp workaround:
Application.Session.DetectSessionDisposed = new DetectSessionDisposed(Application.Session);
internal class DetectSessionDisposed
{
dynamic session;
public DetectSessionDisposed(dynamic session)
{
// just in case you need to access objects in the session
this.session = session;
}
~DetectSessionDisposed()
{
// this code is executed when the session is expired and the GC collects the objects.
}
}
The ApplicationExit event is (should be) fired when the session is disposed. The session is disposed approximately after sessionTimeout * 2 seconds of “inactivity” or if you call Application.Exit(). Inactivity usually means that the client has lost connection (which could mean it was turned off) or the browser or tab are closed. If the app is loaded on a tab it may never expire because there is a keepalive heartbeat – it will show the built-in session-expiring form unless you handle the SessionExpired event.
But… there appears to be a regression causing it to be fired only if you call Application.Exit(). I’m not sure when it was introduced. Will log the bug, should be in the next build.
The session is disposed correctly though allowing the GC to dispose any related object so the connections should still be disposed by the GC.
See attached project and videos:
https://drive.google.com/file/d/1gHxFswrZqYw4aedGuEx0ktWsq3WfTbE0/view
https://www.screencast.com/t/BYwgZ2JM
And forgot to add then when using a DataTable you can use the built in RowFilter property and don’t have to search all rows in your code. In this case the sorting doesn’t need any patch since the data source manages the hidden rows. Try this:
string what2search = "%email%";
var dataTable = (DataTable)this.dg.DataSource;
dataTable.DefaultView.RowFilter = $"NUME LIKE '{what2search}' OR VALOARE LIKE '{what2search}' OR DESCRIERE LIKE '{what2search}'";
As a reference also look at:
The sorting bug is a bit different than what I thought. When the sorting is done by the data source the visible state is reset because the rows are not managed by the DataGridView. You can try the same in the DataGridView in WinForms. Cannot do it in WPF since the DataGrid doesn’t support hidden rows.
This is a workaround until the next build where Wisej.Web.DataGridView will refresh all the rows and the sorting is done by the data source.
private void dg_Sorted(object sender, EventArgs e)
{
Application.Post(() =>
{
this.dg.Refresh();
});
}
It’s not necessary when the rows than change position are less then 16 which is an internal threshold that optimizes the grid updates by only changing the affected cells or rows instead of reloading the current page.
This is a common visual studio problem when the same assembly is loaded multiple time. All component libraries using the designer may hit this issue:
Do this with a new clean project.
Otherwise you have to search for the VS cache and delete it. It’s probably here
C:\Users\%UserName%\AppData\Local\Microsoft\VisualStudio\15.0_6d397e1a\Designer\ShadowCache
15.0_6d397e1a has to be your VS installation instance. There may be more than one.
Regarding ClientProfiles.json, I tried to use this one:
{
“profiles”: [
{
“name”: “Test”,
“maxWidth”: 2025
}
]
}
I set 2025 to be sure it’s more than my fhd display on pc. I modified the size and position of 1 textbox and 1 button on designer (default profile and Test profile). On runtime it display the default size/positions.
The ClientProfiles.json is copied on bin directory.
What am I doing wrong?
PS I’m using 2.2.14 version.
