All Answers

0 votes

Hi Benjamin,

The issue should be fixed now. Can you verify with the latest build? https://www.wisej.com/builds

Let me know!

Best,

Levie

0 votes

Thanks for looking into this Luca.

I have expanded the sample to more reflect the real application I’m working on. The user should get the data and then freely move around in the grids to edit data. The user might select “Arthur” edit data for the sons and even edit data for the sons children. Then the user might select “Uther” to edit data for that. Then when everything looks ok the person can click on “save data” to save everything to the database. To make this work we depend on the datasources to control what lines in the grids that have the selection and what data that should be presented in the child + grandchild grid. Everything works as expected except for the problem with the focused cell. In this case for the datasources to work together I don’t think I can use the DataMember property as you suggested.

Best regards,

Wilfred

0 votes

Hi Ulisses,

You will find the changes here: https://github.com/iceteagroup/wisej-extensions

  1. NavigationBar.Indentation is a new property.
  2. NavigationBar.SelectedItem and SelectedItemChanged are a new property and event, corresponding to a new “selected” state in the theme mixin.
  3. This was fixed a few builds ago.

You can change the indentation in code or designer.

You can change the selected text and background, as well as the hovered color in a theme mixin or in code by changing the theme using Application.Theme.Colors[“navbar-background-selected”] = “red”;

Or in Themes/App.mixin.theme:

{
  "colors: {
    "navbar-text-selected": "yellow",
    "navbar-background-selected": "red",
    "navbar-text-hover": "yellow",
    "navbar-background-hover": "red"
  }
}

HTH

  • Luca answered May 2, 2020 - 4:23 pm
0 votes

Hi Markus,

I have tried to reproduce this problem but failed so far.

Can you please set up a small test case ?

Thanks in advance.

Best regards
Frank

0 votes

Hi Glenn,

Wisej features a built-in Menu Editor that lets you attach event handlers to each menu item. See the attached screenshot.

  1. Click the control (ContextMenu)
  2. Click Edit Menu in the Property Window (see screenshot)
  3. Add menu items
  4. Click menu item
  5. Add event handler for menu item

You can also just add one handler (for a ContextMenu its MenuItemClicked) and determine which child was clicked with the MenuItemEventArgs.

 

Let me know if you have any other questions!

HTH,

Levie

0 votes

There is one thing missing in the custom URL, change it to:

 this.ViewerURL = @"PDF\Javascript\pdfJS\web\viewer.html?file=[source]";

Then you can use the base PdfSource or PdfStream properties:

 this.PDF1.PdfSource = Application.MapPath("mousepad-color-A.pdf");

When using a custom pdf viewer the URL arguments and setup is different for each viewer. Wisej replaces [source] with the postback url. Then if you need “?file=[source]” or “/data/[source]” etc. is up to the viewer.

HTH

 

  • Luca answered May 1, 2020 - 8:10 pm
1 vote

Another option is to use the DataGridView’s EditingControlShowing event.

Something like this:

private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
 {
 e.Control.KeyDown -= myKeyDownEvent;
 e.Control.KeyDown += myKeyDownEvent;
 }

Best,

Levie

0 votes

Hi Wilfred,

There is a pretty easy way to get around this.

  1. Create a TextBox (or other control)
  2. Assign your DataGridView Column editor to this TextBox, i.e., this.dataGridView1.Columns[0].Editor = this.textBox1;
  3. Attach a KeyDown event handler to the TextBox.

Let me know if this works for you!

Best regards,

Levie

0 votes

I think the issue is where you set the DataMember “Knights”. The DataGridView is bound to a BindingSource instance, not to the data directly (Head) but you set the DataMember of the DataGridView to “Knights”. If you set the DataMember of the headBindingSource to “Knights” then it works fine also using BO.Head.GetHead() since it binds to the Knights list.

Otherwise it’s bound to a list that is a property of the data source and when something changes the changes is seen as a list change instead of an data item change.

  • Luca answered May 1, 2020 - 4:31 pm
0 votes

I can reproduce but it doesn’t seem a Wisej issue. I put a break in DataGridView1_CurrentCellChanged and the stack trace shows that the data source is resetting the list when a property changes. Looking at the trace it seems that the data framework thinks that the meta data of the list has changed. It appears that the object Head acts as a list of meta data.

When the data source is changed the grid reloads all the rows and the only information that the data source provides is the current row, there is no current column in the data sources.

I change the code to this and it all works fine:

headBindingSource.DataSource = BO.Head.GetHead().Knights;

  • Luca answered May 1, 2020 - 4:20 pm
0 votes

Hi Davide,

you could use code like this:

string file = "C:\\...";
MemoryStream ms = new MemoryStream();
using (FileStream f = new FileStream(file, FileMode.Open, FileAccess.Read))
    f.CopyTo(ms);
this.pdfViewerAuto.PdfStream = ms;

Just make sure that your App/AppPool on IIS has sufficient rights to access the local path.

Best regards
Frank

  • Frank (ITG) answered May 1, 2020 - 2:14 pm
  • last active May 1, 2020 - 2:15 pm
0 votes
In reply to: Custom PDF viewer

Use

    me.fireDataEvent("myevent", {data});

On the server in your C# class override:

  protected override void OnWebRender(dynamic config)
  {
    base.OnWebRender((object)config);
     config.wiredEvents.Add("myevent1", "myevent2", ...);
  }

  protected override void OnWebEvent(Core.WisejEventArgs e)
  {
    switch (e.Type)
    {
       case "myevent1":
         // do something
         break;
       case "myevent2":
         // do something
         break;
       default:
         base.OnWebEvent(e);
         break;
  }
 }

 

  • Luca answered Apr 30, 2020 - 7:37 pm
0 votes
In reply to: Custom PDF viewer

Standard javascript events don’t keep the context, so “this” in the listener is just a reference to the brower’s window. A common technique when using plain javascript is to save the context in me or self:

var me = this;
window.addEventListener(“message”, function(event) {
   me.fireWidgetEvent(“loaded”, {data: event.data});
});

 

  • Luca answered Apr 30, 2020 - 6:32 pm
0 votes

Hi Winston,

I’ve attached a sample demonstrating the Polygon from the link Luca provided: https://developers.google.com/maps/documentation/javascript/examples/polygon-simple, as you requested.

Please let me know if you have any questions about it!

Best regards,

Levie

0 votes

Hi Glenn,

You can use the VirtualMode property of the DataGridView for loading large datasets. I’m attaching a small sample that uses search-based filtering on a DataGridView in VirtualMode. The comments should explain how to implement the functionality you’re trying to achieve!

Let me know if you have any questions about it.

More info on VirtualMode:

https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.datagridview.virtualmode?view=netcore-3.1

Best regards,

Levie

  • Levie (ITG) answered Apr 30, 2020 - 5:18 pm
  • last active Apr 30, 2020 - 5:23 pm
0 votes
In reply to: MouseEventArgs

Hi Davide,

It’s possible using flags. See this post:

https://stackoverflow.com/questions/3209217/detect-both-left-and-right-mouse-click-at-the-same-time

HTH,

Levie

  • Levie (ITG) answered Apr 30, 2020 - 4:20 pm
  • last active Apr 30, 2020 - 4:40 pm
0 votes

Hi Glenn,

I forgot one, you can also use this:

App.MainPage.TestFuncAsync().then(r => alert(r));

It might cause an issue at design time because the Wisej Designer uses IE.

Best,

Levie

0 votes

Hi Glenn,

You can use a WebMethod to achieve the promise functionality. Using fireWidgetEvent doesn’t return any data from the server.

I’m attaching a sample demonstrating three different ways you can communicate with the server and get the response back in JavaScript.

Check out the method marked with WebMethod in Page1.cs and the Widget’s initScript.

JS

this.init = function(options) { 

if (!wisej.web.DesignMode) { 

//Callback 
//App.MainPage.TestFunc(function(result) { alert(result); }); 

//Add async to function declaration. 
//var result = await App.MainPage.TestFuncAsync(); 
//alert(result); 

//Promise 
var promise1 = new Promise(function(resolve, reject) { 
App.MainPage.TestFunc(function(result) { resolve(result); }); 
}); 

promise1.then(function(result) { alert(result); }); 

} 
}

 

C#

[WebMethod]
 public string TestFunc()
 {
 // Do some logic
 return "done";
 }

 

Let me know if you have any questions about it!

Best regards,

Levie

  • Levie (ITG) answered Apr 30, 2020 - 3:59 pm
  • last active Apr 30, 2020 - 4:05 pm
0 votes

Where can I get the latest version 1.x installer ?

Thats what the applications were built on that i need to edit – unless you feel that just upgrading to 2.x will cause no issues.

0 votes

Hi Edmond,

Have you tried reinstalling Wisej? Make sure to tick the Visual Studio 2015 checkbox during installation.

Let me know if this does or doesn’t work!

Best,

Levie

Showing 4921 - 4940 of 11k results