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
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
Hi Ulisses,
You will find the changes here: https://github.com/iceteagroup/wisej-extensions
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
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
Hi Glenn,
Wisej features a built-in Menu Editor that lets you attach event handlers to each menu item. See the attached screenshot.
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
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
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
Hi Wilfred,
There is a pretty easy way to get around this.
Let me know if this works for you!
Best regards,
Levie
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.
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;
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
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;
}
}
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});
});
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
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:
Best regards,
Levie
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
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
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
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.
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
