All Answers

0 votes

Hi Ivan,

issue #2523 is fixed in our latest Wisej release (2.2.29)

Best regards
Frank

0 votes

Hi Luca.

Thanks for the prompt reply.

Yep, this is what I am doing already, I show the dialog after the image is saved. But it looks like by the time the Html2Canvas does its thing, the dialog is already there.
Anyway, I will see if I can think of a workaround on this one.

Thanks.

0 votes

Show the dialog after the image is saved. Browser don’t support taking a screenshot, the Html2Canvas extension (using this library) rebuilds the page in a canvas and then converts to an image base64 string, then back to an image object on the server. Another way is to use the new media API but it’s not widely supported and it always pops up an authorization dialog with several options, and doesn’t work well.

When I use the Html2Canvas extension even with complex pages it takes about 1-2 seconds. In any case, there is nothing we can do to change it.

  • Luca answered Jan 9, 2021 - 6:37 pm
0 votes

Well, there are many ways. Here are some points:

There can be only one main page so if your projects all have a main page you cannot have a navigation container that switches the pages. In this case each page has to have the navigation options. Then to navigate is as simple as assigning Application.MainPage() or just call page.Show() (it will automatically replace the Application.MainPage).

In alternative, build a main page with the navigation and change the main pages of the projects into just a Panel container, or UserControl. Then the navigation can hide/show (or dispose and create) the panels and dock them to fill a right side container.

You can add a reference of all  the projects to the main navigation project and use their classes but you don’t have to. You can make the whole thing dynamic and load the panels (or pages) dynamically using Assembly.Load() and the Type.GetType() and Activator.CreateInstance() cast to Wisej.Web.Control or Panel. See our https://github.com/iceteagroup/Wisej-Ext-Syncfusion demo. It doesn’t load the assemblies dynamically but it loads the panels dynamically.

For the deployment simply copy the dlls to /bin.

 

  • Luca answered Jan 8, 2021 - 4:29 pm
0 votes
In reply to: Watermark in textbox

Thank you very much! It works!

0 votes

Hi Levie.

Yes, it works for Italian or French, even for pt-PT, which is Portuguese from Portugal. And it works if I don’t set the Windows Culture “Format” to Portuguese (Brazil), which is weird.

Have you tried changing one of your server’s Format to Portuguese (Brazil) and tested the sample to see the results?

  • Ivan Borges answered Jan 7, 2021 - 11:05 pm
  • last active Jan 7, 2021 - 11:28 pm
0 votes
In reply to: Watermark in textbox

 

I attached the mixin file you can use if you need it!

Best,

Levie

0 votes
In reply to: Watermark in textbox

Ciao Messere,

 

Yes both things are possible!

For the placeholder color you can change the “text-placeholder” color in the theme (see attachment).

 

For the font, you’ll need to add a little bit of CSS to your theme or project, you can either add it in the Stylesheet rules of the Theme or in your default.html document:

<style>
 input::-webkit-input-placeholder {
 font-family: 'Brush Script MT', cursive;
 }

 input:-ms-input-placeholder {
 font-family: 'Brush Script MT', cursive;
 }

 input:-moz-placeholder {
 font-family: 'Brush Script MT', cursive;
 }

 input::-moz-placeholder {
 font-family: 'Brush Script MT', cursive;
 }
 </style>

The different entries correspond to different compatibility for each browser.

These can also be achieved via a mixin to your project.

Please let me know if this isn’t clear or you have more questions!

 

Best regards,

Levie

  • Levie (ITG) answered Jan 7, 2021 - 5:21 pm
  • last active Jan 7, 2021 - 5:24 pm
0 votes

Hi Tung,

We’ve completed the enhancement (#2518) and it will be available in the next build that we release!

You’ll find a few new properties as part of the DataGridViewTextBoxColumn

  • AcceptsTab (bool) Specifies whether the DataGridViewTextBoxCell accepts the tab key.
  • AcceptsReturn (bool: Specifies whether the DataGridViewTextBoxCell accepts the enter key.
  • Multiline (bool): Specifies whether the DataGridViewTextBoxCell uses a multiline TextBox.

These three properties correspond to the same properties that are on the TextBox control.

When AcceptsReturn is set to true, it overrides the DataGridView cell losing focus when pressed.

If you have any questions or issues with these, please let me know!

Best regards,

Levie

  • Levie (ITG) answered Jan 6, 2021 - 7:19 pm
  • last active Jan 6, 2021 - 7:20 pm
0 votes

Hi Tung,

Sorry for the delayed response.

We’re looking into enhancing the DataGridView to support this through the DataGridViewTextBoxColumn. See issue #2518.

I’ll keep you updated as we make progress on it!

Best regards,

Levie

0 votes

You’ll need to change it for both the div and the label (see attached).

Best,

Levie

0 votes
In reply to: SyncFusion Controls

Hi Dino,

To use the spreadsheet from our extension you can use these instructions:

  1. Download and build the Wisej Syncfusion extension from GitHub
  2. Reference the library in a new blank Wisej project
  3. Open the designer
  4. Drag and drop the Wisej Syncfusion dll from the bin folder onto the toolbox to add the full set of controls
  5. You can now drag the spreadsheet or any other control onto your page.

I’ve attached a sample project and the resulting screenshot for your reference :-).

Please let me know if you have any other issues with it!

Best,

Levie

0 votes

Hi Isaac,

This issue usually occurs when there are conflicting versions of an assembly loaded at the same time.

  • Make sure the Wisej.Framework reference loaded is from the correct installation destination in C:\Program Files\IceTeaGroup\Wisej 2

I would recommend trying Luca’s proposed solution here:

https://wisej.com/support/question/unable-to-cast-object-of-type-wisej-web-form-to-type-wisej-core-iwisejcontrol-when-re-opening-wisej-project

If that doesn’t work try uninstalling Wisej, deleting everything in C:\Program Files\IceTeaGroup\Wisej 2, and then reinstalling the latest version.

Let me know if you get it working!

 

Best,

Levie

0 votes

There is an attachment here:

https://wisej.com/support/question/aspnetcontrol

Shows how to wrap the report viewer ASP.NET control.

It’s simple, you simply derive a class from Wisej.Web.Ext.AspNetWrapper<T>. Where T is the ASP.NET control class.

Then you have to create the properties and methods that you want to use and assign them to the wrapped ASP.NET control using:

this.WrapperControl.{Property}

WrappedControl is of type T being a generic class.

The only time you can assign those properties to ASP.NET is in the Init, Load, PreLoad events because ASP.NET controls do not exist outside of the page cycle. See the relevant documentation about ASP.NET controls and the page cycle here.

It’s all done in the sample code attached in the original post.

 

  • Luca answered Jan 5, 2021 - 8:22 pm
0 votes

Hi Dino,

The OfficeViewer extension requires that whichever file you’re trying to access is available at a public endpoint.

In the case of the MemoryStream issue, it doesn’t work because you’re running it on localhost.

If you dive into the source code, you see that the extension contains a handler for incoming HTTP requests from the outside and checks for the specified file name.

https://github.com/iceteagroup/wisej-extensions/blob/6e8d112136fc710021c9a5ba79d1c432d028c8be/Wisej.Web.Ext.OfficeViewer/OfficeViewer.cs#L232

 

If Microsoft can’t access your application (because it’s on localhost), it won’t be able to serve the file through the OfficeViewer.

 

You can see on line 250 that it attempts to return the FileStream specified as a response to the HTTPRequest.

https://github.com/iceteagroup/wisej-extensions/blob/6e8d112136fc710021c9a5ba79d1c432d028c8be/Wisej.Web.Ext.OfficeViewer/OfficeViewer.cs#L250

 

If you want to test it, you’ll need to publish your application to a publicly-accessible URL.

 

HTH

Best Regards,

Levie

  • Levie (ITG) answered Jan 5, 2021 - 4:10 pm
  • last active Jan 5, 2021 - 4:12 pm
0 votes

Levie (ITG)
Thank you

I have an additional question.
When creating a custom switch control with a widget
In this.container.innerHTML in initScript
Because ElementById is embedded directly
Multiple custom switch controls on the page
When you make a copy, all the controls are the first one
Bug in custom switch control event
Occurs.

  • Takao Watanabe answered Jan 5, 2021 - 12:32 am
  • last active Jan 5, 2021 - 9:35 am
0 votes

If you want to set the checked state from the server you can add a “checked” property to the Widget’s Options.

In your Widget’s InitScript from the sample you can get/set it by doing something like this:

checkbox.checked = options.checked;

 

On the server, you can do

myCheckboxWidget.Options.checked = true | false;
0 votes

Hi Takao,

The simplest way to use your custom switch checkbox is through the Widget control. I’ve attached a sample that shows how you can implement it and fire the events back to Wisej.

Alternatively, you can play around with the Wisej ThemeBuilder to create a custom theme or mixin for a checkbox (switch) with a different background color, switch button size, animation, etc. but it would be a bit more complicated to make that label show on the inner part of the switch.

If you need that solution, please let me know, but I think the Widget solution should be fine for your case.

Best regards,

Levie

0 votes

Sure!



using System;
using System.Globalization;
using System.Resources;
using System.Threading;
using Wisej.Web;

namespace Localization
{
	public partial class Window1 : Form
	{
		public Window1()
		{
			InitializeComponent();
		}

		private void Window1_Load(object sender, EventArgs e)
		{
			SetValues();

			// get notified when the browser is refreshed.
			Application.ApplicationRefresh += Application_ApplicationRefresh;
		}

		void Application_ApplicationRefresh(object sender, EventArgs e)
		{
			SetValues();
		}

		private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
		{
			// refresh the browser using the new language.
			string[] languages = {"auto","en","de", "it", "fr", "es", "pt-BR"};
			Application.Navigate(Application.StartupUri.ToString() + "?lang=" + languages[this.comboBox1.SelectedIndex]);
		}

		private void SetValues()
		{
			this.labelNumber.Text = 12345678.ToString("c");
			this.labelCurrency.Text = 12345678.ToString("c");
			this.labelDateTime.Text = DateTime.Now.ToString("F");

			var loAssembly = this.GetType().Assembly;

			var RS1 = new ResourceManager("Localization.Resources", this.GetType().Assembly);
			this.Text = RS1.GetString("Title");
			this.button1.Text = RS1.GetString("ShowMessageBox");

			var lcCancel = RS1.GetString("$Cancel");
			var lcShowMessageBox = RS1.GetString("ShowMessageBox");

			var lcCulture = Application.CurrentCulture;

			MessageBox.Show("The buttons are localized", buttons: MessageBoxButtons.YesNoCancel, modal: false);
		}

		private void button1_Click(object sender, EventArgs e)
		{
			CultureInfo ci = new CultureInfo("pt-BR");
			var RS2 = new ResourceManager("Localization.Resources", this.GetType().Assembly);
			var lcCancel = RS2.GetString("$Cancel", ci);
			var lcShowMessageBox = RS2.GetString("ShowMessageBox", ci);

			var lcCulture = Application.CurrentCulture;

			MessageBox.Show("The buttons are localized", buttons: MessageBoxButtons.YesNoCancel, modal: false);
		}
	}
}

The MessageBox in the SetValues shows the Message Buttons properly localized.
On the other hand, the MessageBox in the button1_Click doesn’t. Using the ResourceManager within this Click works properly if I force the CultureInfo, otherwise, it doesn’t.
I tested the Thread.CurrentThread.CurrentCulture inside it and it was properly set as “pt-BR”.

The default language in my Dev machine and in the Google Server is English already.

But, I have a feeling you are on the right track here… In the Control Panel Region, I had (and have to have it) Portuguese (Brazil) as the “Format”, which gives us the right Currency, numbers, dates formats. The Google Servers are also set for this Format. I changed my Dev machine to English (United States) and all worked fine. So, maybe the ResourceManager is not really using the Thread.CurrentThread to get this setting, I would bet.

0 votes

ResourceManager uses the Thread.CurrentThread.CultureInfo. All of .NET localization uses the thread’s culture.

The question is why it fails for you and not for any other machine we tried including azure servers.

Can you check or change the default language on your server to en-US? However I guess that google’s vm is already en-US. In which case it must be a deployment issue.

Can you send the code you just tried and loaded the wrong resource for you?

 

  • Luca answered Jan 2, 2021 - 7:35 pm
Showing 4201 - 4220 of 11k results