All Answers

0 votes

I have tried the ff:

bs.RemoveCurrent();
dataGridView1.Refresh();

Is this the new behavior?

 

Thanks.

0 votes

Hi, any update on this?

0 votes

This exception has been temporarily handled with you provided solution, and we look forward to product updates.
Thanks again!

  • dev answered Oct 20, 2020 - 2:28 am
0 votes

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.

  • Luca answered Oct 19, 2020 - 5:50 pm
0 votes

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.

  • Luca answered Oct 19, 2020 - 12:44 pm
0 votes

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.

  • Luca answered Oct 16, 2020 - 4:32 pm
0 votes

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

0 votes

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.

  • Luca answered Oct 16, 2020 - 3:24 pm
  • last active Oct 16, 2020 - 4:04 pm
0 votes

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

0 votes

Thank you. This is fixed in our internal build.

  • Luca answered Oct 16, 2020 - 3:07 pm
0 votes

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.

 

 

0 votes

ok Luca,

I do a test project, you are right, for some reason the problem it is only in my project.

thank you

Cristian

0 votes

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

 

0 votes

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.
  }
 }
  • Luca answered Oct 9, 2020 - 4:34 pm
0 votes

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.

 

  • Luca answered Oct 9, 2020 - 4:28 pm
0 votes
  • Luca answered Oct 8, 2020 - 5:57 pm
  • last active Oct 8, 2020 - 5:59 pm
0 votes

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:

https://www.csharp-examples.net/dataview-rowfilter/

  • Luca answered Oct 8, 2020 - 5:17 pm
  • last active Oct 8, 2020 - 5:18 pm
0 votes

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.

 

  • Luca answered Oct 8, 2020 - 5:02 pm
0 votes

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:

https://www.google.com/search?q=visual+studio+a+cannot+be+cast+to+b&rlz=1C1CHBF_enUS870US870&oq=visual+studio+cannot+cast&aqs=chrome.1.69i57j0j69i64.5249j0j1&sourceid=chrome&ie=UTF-8

  • Close all the designer windows
  • Close VS
  • Delete /bin and /obj and /.vs
  • Remove the NuGet package
  • Reopen VS (the design must start closed)
  • Clean, Rebuild
  • Close VS
  • Reopen VS and try the designer

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.

 

  • Luca answered Oct 8, 2020 - 4:37 pm
  • last active Oct 8, 2020 - 4:37 pm
0 votes

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.

 

 

Showing 4421 - 4440 of 11k results