Try replacing AppDomain.CurrentDomain.BaseDirectory, AppDomain.CurrentDomain.RelativeSearchPath with Application.StartupPath, it’s probably an issue with the StreamWriter and the path.
Let me know if that works
Best,
Alaa
Hi Sergio,
Are you sure that everything is wired? I just tried it and it works!
Perhaps you can send me a sample?
Best,
Alaa
Thanks for your help
I followed the instructions, installed templates, and created a new project with it.
But Visual Studio reports the following error
Unable to find package Managed.System.Drawing with version (>= 3.5.0-beta.27)
Hi Nikos,
You can install the new 3.5 Hybrid templates here:
Getting Started – Wisej.NET Hybrid
They will be available out-of-the-box in Visual Studio when we release the 3.5 VSIX package for Visual Studio Marketplace.
Best,
Levie
What Accelerator?
Hi Julie, thanks for the sample. Your code works fine, however, if you switch the “View” property of the listview to “Details”… It stops working and works as described by me originally. And yes, I am using Wisej 3.2.7
Thank you
Pavel
What version of Wisej are you using? Can you provide a test case?
I tried with Wisej 3.2.7 and I cannot reproduce. See attached sample.
Quick update, the reason the formatting is weird in winforms is because it creates a text column without a format and the default System.ComponentModel.DateTimeConverter strips the time when it’s midnight. Wisej.NET creates a DataGridViewDateTimePickerColumn (it doesn’t exist in WinForms) with a default format of “g”. You can customize it in several ways:
One is to handle ColumnAdded and change the format
private void DataGridView1_ColumnAdded(object sender, DataGridViewColumnEventArgs e)
{
if (e.Column is DataGridViewDateTimePickerColumn dateColumn)
dateColumn.Format = DateTimePickerFormat.Short;
}
Another is to override DataGridView.CreateDataGridViewColumnFromType() and create or customize any column.
Thank you for the clarification. See below:
HTH
[Use “d” as the format, see https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings]
I’ve read the date/time formats, but I don’t understand, should I create the DataGridView from code? In WinForms and also in Asp.net the DATE columns are displayed correctly to me, not as DATETIME, why doesn’t this happen with Wisej? If I have to redo all the DataGridView logic it would take too long.
Thank you
Hi Francesco,
I can assure you that the CellFormatting event is indeed working, how exactly are you using it?
This is an example on how you should use it:
private void Dgv_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
if (e.ColumnIndex == 0)
{
e.Value = DateTime.Now.ToString("d");
}
}
Best,
Alaa
[The “custom viewer” error maybe a problem with Visual Studio. I don’t know what it means to open a datatable while debugging.]
It’s not a Visual Studio error, because it only happens with Wisej.
To reproduce the error just create a Datatable (here I do it with a query select)
DataTable oSelect = Leo.mytable(“select * from customer”);
If you block the execution and try to see the contents of the Datatable, as you see in the attachment, you receive the error (I translated it from Italian)
Use “d” as the format, see https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings
The “custom viewer” error maybe a problem with Visual Studio. I don’t know what it means to open a datatable while debugging.
You have to download it. Look at the Application.Download methods in the docs. There is also a client file system api (it’s documented on mozilla) that you may use but requires additional permissions.
in general browsers don’t have access to client resources without the proper javascript api.
Hi,
Looks like you have WebSockets disabled? you can verify that by checking the Console in DevTools or checking Application.IsWebSocket.
If that’s the case, you’ll need to do the following modifications:
private async void upload1_Uploaded(object sender, UploadedEventArgs e)
{
Application.StartPolling(100);
await ProcessUploadAsync(e);
Application.Update(this, () =>
{
MessageBox.Show("Upload completed…");
Application.EndPolling();
});
}
HTH,
Alaa
You need to use Application.Update()
Documentation: https://docs.wisej.com/api/wisej.web/general/application#update-context-action
You could do it like this:
private async void upload1_Uploaded(object sender, UploadedEventArgs e)
{
await ProcessUploadAsync(e);
MessageBox.Show(“Upload completed…”);
Application.Update(this);
}
But ideally, you would put the MessageBox call inside the Application.Update() call to insure that the UI is updated when the call ends.
private async void upload1_Uploaded(object sender, UploadedEventArgs e)
{
await ProcessUploadAsync(e);
Application.Update(this, () => { MessageBox.Show(“Upload completed…”); });
}
Hi Tuan,
this is fixed in Wisej.NET 3.2.7 that was just released.
Best regards
Frank
Thanks for the sample. If it helps, the mixin from your sample does work to turn node text red when selected- as long as the HTML isn’t affecting the text color.
For example, if you use HTML to underline the text, your mixin will turn it red on hover:
treeView1.Nodes.Add(new TreeNode("<span style= \"text-decoration: underline\">Node 1</span>") {AllowHtml = true});
Hi Carl,
Wisej.NET AutoUpdater has been deprecated a while ago.
Wisej.NET now comes in 2 parts: One is the nuget packages, which you apparently updated already.
The other is a Microsoft Visual Studio extension.
In order to get you up and running, please deinstall your current Wisej.NET version from the control center.
Then go to this page and download and install the latest Wisej.NET VSIX:
Best regards
Frank
I tried this before.
This approach only works for normal nodes (without html).
Please see my example.
