All Answers

0 votes

To update this thread,

You can now use the Camera extension in Wisej! Get it from GitHub: https://github.com/iceteagroup/wisej-extensions/tree/2.1/Wisej.Web.Ext.Camera

Best regards,

Levie

0 votes
In reply to: Wisej.Ext.Camera

Hi Glenn,

You can get the Camera extension from GitHub here: https://github.com/iceteagroup/wisej-extensions/tree/2.1/Wisej.Web.Ext.Camera

Give it a try and let me know if you have any issues!

Best regards,

Levie

0 votes

See attached variation. This one uses our Html2Canvas extension (https://wisej.com/extensions/) to take an async screenshot of the item and use that image for the dragging cursor. It’s a bit delayed because of the screenshot. I think the icon looks better, but this is fun code.

  • Luca answered Jul 9, 2020 - 5:16 pm
0 votes

I thought it was going to be more difficult but it turned out to be quite easy with Wisej!

In general, drag & drop in Wisej works the same as in a desktop windows app:

  • Set AllowDrag = true on the control that you want to initiate drag & drop and attach the DragStart event.
  • Set AllowDrop = true on the control that you want to drop to and attach DragEnter and DragDrop events (can also attach DragMove and the other events for more granular control)
  • In DragStart start the drag operation calling DoDragDrop() on the control starting the operation and save whatever object you want to drag and set the effects you want to support (move, copy, link, …) – can be more than one in conjunction with Alt, Control.
  • When moving the dragged object the targets will receive the DragEnter (and DragMove) event and there you can decide if the target can “accept” the object and how by setting e.Effect to the effect you want to show to the user (check the allowed effects in e.AllowedEffects).
  • In DragDrop you can handle the dropping. Wisej has an additional property e.DropTarget with the reference to the item under the drop (can be a control or can be a list item or a treenode) so you don’t have to use the coordinates to find out where it was dropped.

Plus you can also change the image of the dragging items. You could also take a screenshot of the item being dragged using the Html2Canvas extension (https://wisej.com/extensions/).

See attached.

https://drive.google.com/file/d/1lz6yFWI8MUahEXhErtRADCIvPheiCwHa/view

  • Luca answered Jul 9, 2020 - 3:22 pm
0 votes

Try with Firefox

0 votes

Works here with the latest dev build. I will try to revert to .77 even though there have been no changes in this area:

https://drive.google.com/file/d/1hJzfcuH5hpPIT-dyWtn487ZylMHEUYp7/view

  • Luca answered Jul 9, 2020 - 2:18 pm
0 votes

Thank you.

Now it’s ok, but a similar situation with textbox textchanged event

private async void textBoxNumero_TextChanged_1(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(textBoxNumero.Text)) { resetUI(false); }
else
{
string s = textBoxNumero.Text;
this.ShowLoader = true;
await findOrd(s, getRicType());
this.ShowLoader = false;
Wisej.Web.Application.Update(this); // update the client
}

}

seems not to update the UI. It is updated only if I move the form or click on it.
What is the best way to do a database search while writing text, without using autocomplete?

0 votes

Please attach  a sample project. Anchoring and docking are exclusive, Docked to Left will will fill vertically, and keep the designed width. All the samples we have with the NavigationBar are docked to the left and the docking engine is the same for all controls and they all work well.

  • Luca answered Jul 8, 2020 - 8:19 pm
0 votes

Try this:

http://demo.wisej.com/syncfusion/

It’s an internal demo: it can be down, can be under update, can have errors, etc…

We have the same for DevExpress, Infragistics, Telerik. As of now those extensions are available for free only to Technology Partners. We may make them available on their own but I don’t know yet the details.

  • Luca answered Jul 8, 2020 - 6:18 pm
1 vote

blog says…”Wisej has integrated Syncfusion’s entire JavaScript control library…” I think this is a game-changer!!!

Does this mean that for a NEW WEB project if I use WiseJ + Syncfusion JS lib than I can simply drag/drop control and write event-driven programming like WinForms without bothering abt Html/js/CSS? Will it work seamlessly and flawlessly?

Do you have a live demo link showcasing WiseJ integration working well with all the Syncfusion JS controls?

  • Hitesh Davey answered Jul 8, 2020 - 5:20 pm
  • last active Jul 8, 2020 - 5:22 pm
2 votes

When using async/await, the C# compiler adds a return statement and “extracts” all the following code into a new callback function. So when you have an “await” it’s like having a “return” statement.

Which means that the request coming from the browser receives a response, and the rest of the code will run “out-of-bounds”, basically without a corresponding request, so it’s unable to update the client unless you call Application.Update() to push the update (works only with WebSocket), or use the automatic polling, or something is requested by the browser.

In your case:

  • No need to call Application.Update(this, async…) because the await inside will cause the exit of the Update() block pushing an unnecessary update to the browser since you are already responding to a request.
  • The cellDoubleClick most likely causes a new request from the datagrid in the browser (begin edit or similar) which is then able to receive the update from the server.
  • The code is better like this:
private async void button1_Click(...) {
      
     this.ShowLoader = true;

     await Task.Delay(3000); // simulate async call
     // the client is update automatically since the request ends here.

     this.ShowLoader = false;
     Application.Update(this); // update the client
}
  • Luca answered Jul 8, 2020 - 2:04 pm
0 votes

Just tried a FlexLayoutPanel with the header title and no close button and it doesn’t collapse when clicking the header.

If the issue is that the panel expands when you collapse it programmatically, then it’s the panel.AutoShow property. You can set it to “Never”.

  • Luca answered Jul 8, 2020 - 1:55 pm
0 votes
In reply to: How to make a report

You could use Stilmulsoft’s report designer.

/// <summary>
/// Provides a Visual WebGui callable wrapper for Stimulsoft.Report.Web.StiWebDesigner.
/// </summary>
[System.ComponentModel.ToolboxItem(true)]
public partial class WebReportDesigner : AspNetWrapper<StiWebDesigner>
{
bool IsLoaded = false;
public WebReportDesigner()
{
InitializeComponent();

Stimulsoft.Base.StiLicense.Key = “xxxxxxxx”;
}
protected /*override*/ bool IsFixedSize
{
get
{
return true;
}
}
public override bool AutoScroll
{
get
{
return false;
}
set
{
base.AutoScroll = value;
}
}

StiCacheHelper _CacheHelper;
StiServerCacheMode _CacheMode = StiServerCacheMode.ObjectSession;
StiReportUnitType _DefaultUnit = StiReportUnitType.Centimeters;
string _GlobalizationFile = string.Empty;
string _ImagePath = string.Empty;
StiInterfaceType _InterfaceType = StiInterfaceType.Auto;
StiDesignerPermissions _PermissionBusinessObjects = StiDesignerPermissions.All;
StiDesignerPermissions _PermissionDataColumns = StiDesignerPermissions.All;
StiDesignerPermissions _PermissionDataConnections = StiDesignerPermissions.All;
StiDesignerPermissions _PermissionDataRelations = StiDesignerPermissions.All;
StiDesignerPermissions _PermissionDataSources = StiDesignerPermissions.All;
StiDesignerPermissions _PermissionVariables = StiDesignerPermissions.All;
int _PropertiesGridLabelWidth = 160;
int _PropertiesGridWidth = 370;
StiReport _Report;
string _ReportGuid = string.Empty;
TimeSpan _ServerTimeout = DateTime.UtcNow.AddSeconds(30).Subtract(DateTime.UtcNow);
StiDesignerTheme _Theme = StiDesignerTheme.Office2013LightGrayBlue;
//StiWebImageHost _WebImageHost;

public StiCacheHelper CacheHelper { get { return _CacheHelper; } set { _CacheHelper = value; } }
[DefaultValue(StiServerCacheMode.None)]
public StiServerCacheMode CacheMode { get { return _CacheMode; } set { _CacheMode = value; } }
[DefaultValue(StiReportUnitType.Centimeters)]
public StiReportUnitType DefaultUnit { get { return _DefaultUnit; } set { _DefaultUnit = value; } }
[DefaultValue(“”)]
public string GlobalizationFile { get { return _GlobalizationFile; } set { _GlobalizationFile = value; } }
[DefaultValue(“”)]
public string ImagePath { get { return _ImagePath; } set { _ImagePath = value; } }
[DefaultValue(StiInterfaceType.Auto)]
public StiInterfaceType InterfaceType { get { return _InterfaceType; } set { _InterfaceType = value; } }

[DefaultValue(StiDesignerPermissions.All)]
public StiDesignerPermissions PermissionBusinessObjects { get { return _PermissionBusinessObjects; } set { _PermissionBusinessObjects = value; } }

[DefaultValue(StiDesignerPermissions.All)]

public StiDesignerPermissions PermissionDataColumns { get { return _PermissionDataColumns; } set { _PermissionDataColumns = value; } }
[DefaultValue(StiDesignerPermissions.All)]
public StiDesignerPermissions PermissionDataConnections { get { return _PermissionDataConnections; } set { _PermissionDataConnections = value; } }
[DefaultValue(StiDesignerPermissions.All)]
public StiDesignerPermissions PermissionDataRelations { get { return _PermissionDataRelations; } set { _PermissionDataRelations = value; } }
[DefaultValue(StiDesignerPermissions.All)]
public StiDesignerPermissions PermissionDataSources { get { return _PermissionDataSources; } set { _PermissionDataSources = value; } }
[DefaultValue(StiDesignerPermissions.All)]
public StiDesignerPermissions PermissionVariables { get { return _PermissionVariables; } set { _PermissionVariables = value; } }
[DefaultValue(160)]
public int PropertiesGridLabelWidth { get { return _PropertiesGridLabelWidth; } set { _PropertiesGridLabelWidth = value; } }
[DefaultValue(370)]
public int PropertiesGridWidth { get { return _PropertiesGridWidth; } set { _PropertiesGridWidth = value; } }
[Browsable(false)]
public StiReport Report { get { return _Report == null ? new StiReport() : _Report; } set { _Report = value; } }
[Browsable(false)]
public string ReportGuid { get { return _ReportGuid; } set { _ReportGuid = value; } }
[DefaultValue(false)]
public TimeSpan ServerTimeout { get { return _ServerTimeout; } set { _ServerTimeout = value; } }
[DefaultValue(StiDesignerTheme.Office2013LightGrayBlue)]
public StiDesignerTheme Theme { get { return _Theme; } set { _Theme = value; } }

protected override void OnInit(EventArgs e)
{
var viewer = this.WrappedControl;
viewer.CacheMode = CacheMode;
viewer.DefaultUnit = DefaultUnit;
viewer.InterfaceType = InterfaceType;
viewer.PermissionBusinessObjects = PermissionBusinessObjects;
viewer.PermissionDataColumns = PermissionDataColumns;
viewer.PermissionDataConnections = PermissionDataConnections;
viewer.PermissionDataRelations = PermissionDataRelations;
viewer.PermissionDataSources = PermissionDataSources;
viewer.PermissionVariables = PermissionVariables;
viewer.PropertiesGridLabelWidth = PropertiesGridLabelWidth;
viewer.PropertiesGridWidth = PropertiesGridWidth;
viewer.Report = Report;
viewer.Theme = Theme;

// attach the handled events to fire the event on the wrapper.
if (this.CreateReport != null)
viewer.CreateReport += viewer_CreateReport;
if (this.Exit != null)
viewer.Exit += viewer_Exit;
if (this.GetReport != null)
viewer.GetReport += viewer_GetReport;
if (this.PreviewReport != null)
viewer.PreviewReport += viewer_PreviewReport;
if (this.SaveReport != null)
viewer.SaveReport += viewer_SaveReport;
base.OnInit(e);
}

private void Viewer_PreviewReport(object sender, StiReportDataEventArgs e)
{
throw new NotImplementedException();
}

void viewer_CreateReport(object sender, StiReportDataEventArgs e)
{
Application.Update(this, () =>
{
CreateReport(sender, e);
});
}

void viewer_Exit(object sender, StiReportDataEventArgs e)
{
Application.Update(this, () =>
{
Exit(sender, e);
});
}

void viewer_GetReport(object sender, StiReportDataEventArgs e)
{
Application.Update(this, () =>
{
GetReport(sender, e);
});
}

void viewer_PreviewReport(object sender, StiReportDataEventArgs e)
{
Application.Update(this, () =>
{
PreviewReport(sender, e);
});
}

void viewer_SaveReport(object sender, StiSaveReportEventArgs e)
{
Application.Update(this, () =>
{
SaveReport(sender, e);
});
}

void viewer_LoadReport(object sender, StiReportDataEventArgs e)
{
Application.Update(this, () =>
{
LoadReport(sender, e);
});
}

public event StiReportDataEventHandler CreateReport;
public event StiReportDataEventHandler Exit;
public event StiReportDataEventHandler GetReport;
public event StiReportDataEventHandler PreviewReport;
public event StiSaveReportEventHandler SaveReport;
public event StiReportDataEventHandler LoadReport;
}

0 votes

I tried this on our NavigationBar sample in https://wisej.com/examples/ (click on the github link):

 

this.panel1.Items.RemoveAt(0); // any variation
// or
this.panel1.Items[0].Dispose();

 

Do you get an error? It seems to work fine:

https://drive.google.com/file/d/1oFe8nuciSjkg6dzwOCgkCCKsckTW_Yah/view

  • Luca answered Jul 7, 2020 - 2:50 pm
0 votes

Hi Neil,

you can use the Items collection of the NavigationBar to show/hide items.

this.navigationBar1.Items[1].Visible = false;

Best regards,
Frank

0 votes

Luca,

Thanks for suggestions! Debugger was configured fine but JustMyCode was enabled, I’ve disabled it. Nevertheless I gave up reproducing the issue in debug mode, as it appears very very rarely. Only sometimes I can see it in test environment (dev server, hosted in IIS, release mode..). Strangely, when compilation debug=”true” and app running in IIS (release or debug mode) stack trace is still empty (and WisejCore.debugMode is false as well)!

However, it might not matter any much as I found the code line which causes it – loginCtrl?.Dispose(); which is called at some point in loginCtrl.Load event (when we auto log in a user and want to dispose loginCtrl to free up a resources) – please let me know if there’re better practices to do it. Do I need to remove it from its parent first? Can it cause such an issue when running in non-user context (other thread)? Maybe Wisej dev team can review if Wisej UserContol/Control may have any null reference leaks?

(logincCtrl itself or its subcontrols have no custom Disposed events attached)

 

UPDATE, solution found: Once I wrapped it in Application.Update and added Controls.Remove(loginCtrl);

It started to work fine it seems. So instead of loginCtrl?.Dispose(); code looks like following now:

Application.Update(this, () =>
{
if (loginCtrl != null)
{
if (Controls.Contains(loginCtrl))
{
Controls.Remove(loginCtrl);
}
loginCtrl.Dispose();
loginCtrl = null;
}
});

So it’s likely something inside .Dispose() at Wisej side may cause null reference errors

  • Michael M answered Jul 6, 2020 - 1:39 am
  • last active Jul 7, 2020 - 1:43 am
0 votes

Thanks for the modified sample. You are a very good teacher. And a quick one!

  • Wrong patch still had an error.
    With the new patch it’s working excellent. And I’d learned how to include a patch 🙂
  • The sample code set the DataSource to null before changing the WrapMode on the columns, but there are zero columns when removing the data source
    I (wrongly) presumed that DefaultCellStyle is considered just when the Datadrid is filled.
  • Both buttons set WrapMode to True
    In the real project it was correct. Damn copy-paste bug 🙂
  • No need to remove the data source
    Again: I (wrongly) presumed that DefaultCellStyle is considered just when the Datadrid is filled. And I’m still using that for quick resize columns. My way is still (many times) faster than AutoResizeColumns provided by wisej. If you want to develop this aspect, I’m always available.
  • No need to set the size in the Shown event, you can anchor right and bottom
    Thank you. I never thought I can use more than one corner!
  • If you set AllowHtml = true on the columns it will render the html in the cells (screenshot)
    Thank you again. In the real project I have tinyEditor for html column, and unfortunately not all values are html. Can the datagrid make distinction between html/non-html values? What if I allow inline editing for html values?
  • Adrian Zagar answered Jul 6, 2020 - 5:53 pm
  • last active Jul 6, 2020 - 5:59 pm
0 votes

Try starting a project in .Net 2 – then add the references, then switch back. I’ve had this trouble since using .Net 4 years ago! Be careful with losing other references etc though. I’ve even taken to copying references from a working project into new ones by editing the csproj file!

Here’s an example of what I copy across into the <ItemGroup> section in the project file. We’re using 13.0.24 so the Version number may differ on your system:

    <Reference Include=”CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, processorArchitecture=MSIL”>
      <SpecificVersion>False</SpecificVersion>
      <Private>True</Private>
    </Reference>
    <Reference Include=”CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, processorArchitecture=MSIL”>
      <SpecificVersion>False</SpecificVersion>
      <Private>True</Private>
    </Reference>
    <Reference Include=”CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, processorArchitecture=MSIL”>
      <SpecificVersion>False</SpecificVersion>
      <Private>True</Private>
    </Reference>
    <Reference Include=”CrystalDecisions.Windows.Forms, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, processorArchitecture=MSIL”>
      <SpecificVersion>False</SpecificVersion>
      <Private>True</Private>
    </Reference>
0 votes

Thanks for the sample. See attached. And sorry for the wrong patch, these are the issues (some unrelated to the autosizing of the rows):

  • Wrong patch still had an error.
  • The sample code set the DataSource to null before changing the WrapMode on the columns, but there are zero columns when removing the data source
  • Both buttons set WrapMode to True
  • No need to remove the data source
  • No need to set the size in the Shown event, you can anchor right and bottom
  • If you set AllowHtml = true on the columns it will render the html in the cells (screenshot)

The attached adjusted sample includes the latest fix (is in the dev. build)  so you can also see how to include bundled js with your app.

Video:

https://drive.google.com/file/d/1Q94V4deU14D2_BKEEch3ONuxq55IMCCV/view

  • Luca answered Jul 6, 2020 - 2:44 pm
0 votes

I attached a small project, maibe it will be easier to tell what I’m doing wrong. You’ll have to add nugget Newtonsoft.Json because I can’t upload more than 3.9M…

Thank you,

Adrian

Showing 4701 - 4720 of 11k results