I’m working on trying to make a repro for this issue – and wow does it ever repro. In fact, it repros so much that I can’t even get to the point where the full app has problems.
I have a feeling that this is an automatic layout issue. The page I’m testing has 7 DGVs and a number of FlexLayoutPanels, with nearly everything set to autosize and/or dock.Fill. In my sample app, I can’t even insert a single row of data into the DGVs without the page locking up.
In this “locked up” state, the browser is using a small but consistent amount of CPU (about 1%); iisexpress is not using and CPU, nor is devenv.exe, so it looks like it’s the browser itself – presumably the JavaScript engine – which is getting stuck.
Where can I send my repro application? It’s a very stripped down version of the real application that I’m working on, so I do not want to post it publicly.
Thank you I appreciate this, but my themes folder only has my custom theme in it and some odd mixin .
It does not represent the content of this list that I see in the designers of the controls as shown in the previous image attachment,
that I am attempting to access and provide to user for dynamic selection
There isn’t a built-in method for Wisej for getting the themes from the themes folder specifically.
However, you can just check the Themes folder and get a list of the files in it.
Just use DIrectory.GetFiles()
https://learn.microsoft.com/en-us/dotnet/api/system.io.directory.getfiles?view=net-8.0
https://stackoverflow.com/questions/12524398/directory-getfiles-how-to-get-only-filename-not-full-path
Thank you.
Is it possible to create properly autosize when HTML allowed is true PANEL. If yes, please for small solution sample.
Kind regards
Hello Levie,
I’ve attached a sample project to this Link. I could not use the upload from this Forum because of the Limit 3,9 MB.
In the sample, I’ve implemented the behavior I mentioned in the OnClick
method of LocalWebserver.Page1
.
In the Program.cs
file of RemoteWebserver
, I’ve registered the corresponding endpoint where the request is handled. However, as I mentioned earlier, Application.Navigate
does not wait until RemoteWebserver
navigates back to the local webserver. As a result, when I try to read the response from that request, I receive an empty response because the request has not yet been executed.
If you’d like to test it yourself, you can set the URL of the RemoteWebserver
in Shared.Navigation.Funktionen.Navigation.cs
.
I hope you get what we are trying to accomplish with this architecture and can help us.
Best regards,
Konstantin
Hi, Frank!
I have attached a small test. This is the only thing missing for me to complete a project.
Thanks for your help!
Ulisses.
Check your Default.json file, it should have this code:
{
"url": "Default.html",
"startup": "WisejWebPageApplication1.Program.Main, WisejWebPageApplication1"
}
“WisejWebPageApplication1” will be different for your project.
For example if your namespace was NAMESPACE1 :
namespace NAMESPACE1 {
internal static class Program {
//more code..
and your assembly name was ASSEMBLYNAME1:
(Note: By default the assembly name will match the project name, but you can override it in the .csproj file with the “AssemblyName” tag)
then your default.json would look like this:
{
"url": "Default.html",
"startup": "NAMESPACE1.Program.Main, ASSEMBLYNAME1"
}
If your default.json file looks fine, check to make sure that there’s not a permissions issue with accessing/running the startup file.
Hi Ulisses,
can you please wrap a small test case showing what you tried already?
Best regards
Frank
Hi Carl,
if you can wrap up the DGV that has these issues in a test case, we can take a look.
Otherwise it’s impossible from here to guess why it behaves in a different way compared to the other 4.
Best regards
Frank
Hi,
that’s by design, read here
https://docs.wisej.com/docs/controls/general/autosizing#html-autosizing
Best regards
Frank
Yes, there is a better way.
Use EditingControlShowing (e.Control is the ComboBox).
In the handler simply do:
((ComboBox)e.Control).SelectedIndexChanged -= ...
and ((ComboBox)e.Control).SelectedIndexChanged += ...
Doing always -= and += ensures that there is only one handler attached.
Alternatively, you could create a custom column and override OnSelectedItemChanged in DataGridViewComboBoxEditingControl.
Hey Konstantin,
There is no popup window in a Hybrid app – only application redirects. So the onclose handler will not work. There shouldn’t be any reason to put the current thread to sleep while waiting.
You might want to look at the Application.ApplicationRefresh event handler to manage a redirect.
If you attach a small runnable sample we can try to provide more help!
Best regards,
Levie
We’re working on a fix that will be included with the next release of Wisej.NET.
In the meantime, the workaround is to do Me.DataGridView1.AllowUserToAddRows = True
in the Load event instead of setting it in the designer.
-Julie
Thank you,
all solved 🙂
Hello Alex,
Please download the updated sample from https://drive.google.com/file/d/1WmKb3j3XDMFxyZ0zAJZ0Idx5X_93ioEu/view?usp=drive_link
Look at the new Web.config file and make sure you clear the browser cache before running the sample!
Best regards,
Alaa
Hi guys,
I’m trying to access the PDFViewerApplication object myself, and I came across this thread. I downloaded Alaa’s example application from 2022, and tried to upgrade it to the latest pdfjs version (4.5.136). When the application starts, I get an error 404.3 for two .mjs files not found (viewer.mjs and pdf.mjs). In your version back in 2022 there weren’t any .mjs files, the equivalent were .js.
I added handlers for .mjs static files in my web.config, and then I get the errors:
Failed to load module script: Expected a Javascript module script but the server responded with a MIME type of “application/octet-stream”. Strict MIME type checking is enforced for module scripts per HTML spec.
Any suggestions would be greatly appreciated.
Best,
Alex
The JavaScript you need is:
config.options.scales.yAxes[0].ticks.callback = (label) => `$ ${label}`;
or
config.options.scales.yAxes[0].ticks.callback = (label) => label.toLocaleString("en-US", { style: "currency", currency: "USD" });
You need to run it in the InitScript of the ChartJS widget (so it runs when the chart is set up). In order to do that, you’ll need to create a class derived from ChartJS that uses a custom InitScript. In this sample, that class is called MyChartJS.
See code sample.
Thanks Julie & Frank.
I’m experimenting with getting all of the DGVs to behave properly now. I’m finding it very difficult to get this to work. (Visual Studio 17.10.4, WiseJ designer 3.5.10, WiseJ runtime).
I’ll give all the links the Julie supplied a read… I’m VERY familiar with Windows Forms, so all of these concepts are well known to me. Even in Windows Forms, the interactions between Dock and AutoSize are not always well behaved – years of building UIs has taught me what works in WinForms – I’m trying to make that knowledge work with WiseJ!
Frank beat me to it, but I’ll go ahead and post my answer as well:
If you haven’t already, make sure to look at the documentation for DataGridView:
https://docs.wisej.com/docs/controls/lists/datagridview
https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview
Automatic sizing to the content (no scroll bars)
https://docs.wisej.com/docs/controls/lists/datagridview#autosizing
https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview#scrollbars
https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.scrollbars
Flow layout for the whole page
You will find the documentation on layouts to be helpful: https://docs.wisej.com/docs/concepts/layouts Note that this applies to all Wisej controls, not just datagridview.
If you want the datagridview to fill the whole page, set Dock to Fill. This can either be done in the designer or via code:
dataGridView1.Dock = Wisej.Web.DockStyle.Fill;
If you have other controls on the page, consider placing the datagridview and the controls inside a FlexLayoutPanel or FlowLayoutPanel.
Read-only
You can set the DataGridView to be read-only either in the designer (set the ReadOnly property of the datagridview) or via code:
dataGridView1.ReadOnly = true;
If you do decide to go the ReportViewer route, I would recommend generating the report and then using the Wisej PDFViewer to display it. https://docs.wisej.com/docs/controls/content/pdfviewer
-Julie
Hi Carl,
all of this can be done with Wisej.NET and its DataGridView.
Use AutoSizing by mode:
https://docs.wisej.com/docs/controls/lists/datagridview#autosizing
Or use the AutoResize* functions and fine tune with Fill Width and MinSize/MaxSize
For Flowlayout you can use Docking.
ReadOnly is simply a property.
Best regards
Frank