I would also recommend trying this sample, which is more relevant and simpler!
It creates a handler in C# for the tab button’s double click event through the custom “MyTabControl” class.
Best,
Levie
Hi Adrian,
It’s possible using JavaScript. Please see the initScript Property of the TabControl (of the attached project). This is a basic format you can use to achieve the double click functionality!
You can also play around with the selector to achieve a cleaner format if you want!
Let me know if this helps,
Best,
Levie
Here is a third way to achieve the same. This one allows you to set the same culture multiple times since Equals() checks for the instance identity and it’s cleaner IMO since you can set your custom changes in one place.
Application.CurrentCulture = new MyCulture("ro-RO");
public class MyCulture : CultureInfo {
public MyCulture(string name) : base(name, true) {
this.NumberFormat.CurrencySymbol = "#";
}
public override bool Equals(object value) {
return this == value;
}
}
WinForms and VWG don’t have Application.CurrentCulture. You can change the culture on the current thread without checks. Wisej checks if it’s the same culture using culture.Equals() which checks the name of the culture before altering the culture which triggers several updates in Wisej that are all missing from VWG and work differently on WinForms since the desktop is the same machine as the “server”.
I tried these two options and both work well:
Program.Main() {
var ro = new CultureInfo("ro-RO", true);
ro.NumberFormat.CurrencySymbol = "#";
Application.CurrentCulture = ro;
}
Program.Main() {
var ro = (CultureInfo)CultureInfo.GetCultureInfo("ro-RO").Clone();
ro.NumberFormat.CurrencySymbol = "#";
Application.CurrentCulture = ro;
}
If you set culture=”ro-RO” also in default.json you are setting the culture twice, the first time using the original “ro-RO” and then programmatically again but using the same culture (same name). Just set your modified culture the first time at startup.
That’s the correct error. If the data grid is data bound then adding summary rows adds them to the data source, which is incorrect.
You can add rows programmatically or you can try the datagrid1.Fill() methods to load the data source without being data bound.
Here’s a screenshot without using websockets, check the data in “Response” and the size in “Headers”.
The Wisej Web Application template features one Form instance (Window1.cs).
The Wisej Web Page Application template features a Page instance (Page1.cs).
What you should use depends on your goal:
https://wisej.com/support/question/windows-or-pages
Best,
Levie
Hi Glenn,
Are you using WebSockets?
You can view the size of the data that’s transmitted under app.wx in Network Source in Chrome (see the attached picture)
Let me know if you have any questions about it!
Best,
Levie
Hi Luca,
After several testing and discussions with final client I’m still in trouble. I got your point, and I can change the culture with an existing one (in my case, ro-RO). The problem is that my client (and not only that client) want a mixture of settings (en-US as base with different date format, and some other differences). Every way I tried to create a new one by code failed.
In both winforms and Webgui the code I provided in my first post is working. In Wisej it’s not, and I didn’t find until now a workaround.
Please help!
Hi Luca,
did the sample help?
Do you need additional information?
Thank you for looking into the problem.
If you run code in a thread you must call Application.Update(). Browsers only receive a response if there is a request. WebSocket allows for a push update, which requires a push.
If Application.Update() works then it’s using WebSocket.
If you check Application.IsWebSocket in Program.Main it will always be false since the first request is always http.
HTH
So here is my setup:
Dim x As Integer = 2
Do
Invoke(Sub()
PanelContentContainer.Controls.Clear()
PanelContentContainer.Controls.Add(ShownPanelList(x))
End Sub)
ElaspedSeconds= 0
Do While ElaspedSeconds< ChangeSeconds
ElaspedSeconds+= 1
Invoke(Sub()
ProgressCircle1.Value = Math.Floor((ElaspedSeconds/ ChangeSeconds) * 100)
LabelTime.Text = Now.ToLongDateString & ” ” & Now.ToLongTimeString
End Sub)
Threading.Thread.Sleep(1000)
Loop
If x<> ShownPanelList.Count – 1 Then
x+= 1
Else
x= 0
End If
Loop
Edit 1#: This sub is inside a Thread.
Edit 2#: Adding Application.Update(Me) after setting the Invoke which sets the time seems to solve this issue, but still it’s not running in websocket mode.
Hi László,
I’m not sure I fully understand your setup. Can you please attach a small sample replicating the issue?
Best,
Levie
Hi Huỳnh,
Wisej’s PdfViewer is not based on an iFrame. If you want to print it you should use another method. Print via PrintJS or something similar. PDF.js would work too.
Best,
Levie
Hi Luca (ITG),
I am using crystalReport. It allows export to Memory stream pdf.
How to do showing Memory stream pdf into IFrame javaScript?
Thank you so much.
Hi Nello,
Would you be able to send us your theme with a small sample application that reproduces the spacing issue? It’s hard to tell the issue from here.
In regards to the icons not loading, I would suggest restarting your machine and checking that Internet Explorer is working correctly.
All the SVG’s you are supposed to see are rendered in mini IE browsers, so if they aren’t showing up there must be an issue with IE.
Let me know!
Best,
Levie
Setting the style of the content element directly is overridden by the theme setting the properties and styles of the actual widget. In particular the margin property is translated to style positions since you cannot use margin in css with absolute positions by the underlying javascript layout engine.
Either you do it after the dom is rendered or it’s much simpler to change the theme.
You can:
Solution 2 is the preferred one. New Item -> Mixin theme. see below and attached. Arrays are in the standard TRBL sequence.
{
"name": "Application",
"appearances": {
"datefield": {
"inherit": "datefield",
"components": {
"textfield": {
"states": {
"default": {
"properties": {
"margin": [ 0, 0, 0, 2 ]
}
}
}
}
}
}
}
}
The issue is that the designer in Wisej fixes the error in the code but if you don’t save it you will get the error at runtime.
The code from VWG is wrong, and it may have worked because of a bug in VWG layout.
Anchoring anchors a control to the parent’s sides. Looking at the code you have coming from VWG, you can see that:
This shows identical in the designer and at runtime. Anchoring the datagrid t,l,r,b means that the proportional distance on the 4 sides is maintained: when the container is resized, the distance of the datagrid’s 4 sides to the container is preserved.
Since the grid us 352 in height and the parent splitContainer.Panel2 is 410 in height, the bottom of the grid will always be 410-352 = 58 pixels from the bottom of the panel.
The wrong code is in InheritedDataForm:
Looks like the designer code in InheritedDataForm was changed by hand or VWG generated the wrong dimensions.
Which means that in InheritedDataForm the size of the grid and the bottom of the grid are much smaller than the parent and the bottom grid will be 883-635=248 pixels from the bottom of the container.
The layout depends on the state of the layout engine and the corresponding calls to SuspendLayout() and ResumeLayout() and the designer is applying them in the design order to fix the layout, but you need to save it or the wrong code will run at runtime.
The only issue I see is that the designer didn’t mark the file as modified when it should. See screenshot 2, the designer changed the grid to be 1249 x 1021 to make it work but if it’s not saved the original proportions will be used at runtime.
Documents in browsers are loaded asynchronously. If you print after assigning the src the iframe is empty. You can use jsfiddle to test your javascript code. See https://www.w3schools.com/jsref/event_onload.asp
In your code you can try to change it like this:
var objFra = document.createElement('iframe'); // Create an IFrame.
objFra.style.visibility = "hidden"; // Hide the frame.
objFra.src = "ReadMe_001.pdf"; // Set source not done .pdf.
objFra.onload = function(){
objFra.contentWindow.focus(); // Set focus.
objFra.contentWindow.print(); // Print it
};
document.body.appendChild(objFra); // Add the frame to the web page.
Hi Nello,
If you downloaded Wisej from Wisej.com/builds it comes with the installation package. Try searching for Wisej.ThemeBuilder or Wisej in the search bar and make sure you filter by Applications. If you can’t find it, I’d recommend reinstalling Wisej.
Once you have a theme file you can add it to your project with the following:
You can also load / change your theme at runtime with:
Application.LoadTheme("myThemeName");
You should be good to go then!
Let me know if you have issues.
Best regards,
Levie
