Yes! How did I do to not see the UserDeletingRow and UserDeletedRow events!?,
thank you Luca Sky Walker
The clients will have to register themselves. A simple http request (ashx handler would do). They can send their name or anything else as an argument. The server can keep track of the clients by name or id and should also save their IPs (use Application.UserHostAddress to read the IP of the client that is registering).
Then the server can send requests back to the IP address of the clients.
If the client is rebooted or if the client uses a dynamic IP that may change, the the client should simply periodically refresh its IP again through a simple http request.
Cells are not widgets and don’t have a location or size, they are rendered in the browser by building the HTML using the various cell renderers.
You can use Control.MousePosition.X for the X position, it’s already relative to the screen.
You can calculate the top or bottom of the cell in CellMouseDown like this:
for (int i = this.dataGridView.FirstDisplayedRowIndex; i <= e.RowIndex; i++)
{
bottom+= this.dataGridView.Rows[i].Height;
}
Add the header height.
bottom += this.DataGridView.ColumnHeadersHeight;
Convert to screen.
var loc = this.DataGridView.PointToScreen(new Point(0, bottom));
Show the popup.
popup.ShowPopup(Control.MousePosition.X, bottom);
To align the left position is more complicated since the columns may scroll partially.
Check the UserDeletingRow and UserDeletedRow events.
Check the UserDeletingRow and UserDeletedRow events.
Found the problem. Works when changing the culture, but doesn’t work when the culture is already changed at startup. Logged, will be fixed in the current dev build.
Can’t reproduce. Can you reproduce in a separate small app? I dropped a groupbox, added some controls, add a binding source:
this.groupBox1.DataBindings.Add(new Wisej.Web.Binding(“Enabled”, this.dataBindingSource, “CanSave”, true));
Closed, reopened. Always works.
The e.RowIndex is correct. It’s the index of the removed row. The sample app is using the deleted index to read the value from the row collection, but the row has been deleted (removed from the collection) so the index is referring to the next row now. The event RowsRemoved is fired after the rows have been removed. There is no event fired before the rows are removed – it’s entirely up to the application.
There is a bug with the initial RowRemoved (index 0) events with count 0. Logged will be fixed in the current dev build.
Hi Marian,
I can’t reproduce the behaviour you describe. I attach a sample.
I see, that’s nice. But why does it not set Thread.CurrentUICulture anymore? Thread.CurrentCulture appears to be set properly still, but Thread.CurrentUICulture is always en-US for me. Thread.CurrentUICulture is necessary for ResourceManager I believe.
Ok, Thanks, waiting for the fixing
Hi again,
While we fix the issue, you can use a workaround:
Insert an extra line before setting the Width value you want, like this
Snippet
((Wisej.Core.IWisejComponent)dataGridView1.Columns[0]).Configuration.width = 0; dataGridView1.Columns[0].Width = 300;
Thanks for the sample. I could reproduce. Logged as WJ-8984.
Thank you for sample. It works fine here, but I see what the problem is:
localhost:8080/Handler1.ashx?name=Test
The handler is found and executed correctly.
You get 404 probably because you are not using the handler but the url mapping in web.config, which is a non-existing url mapped to the handler.
localhost:8080/post-data?name=Test returns 404 with the self hosted executable.
You can fix this in WisejMiddleware.cs, see method ProcessSubApplication(IOwinContext context), the last line is:
return this.Next.Invoke(context);
Change it to:
return ProcessAspNetRequest(context);
The mapping doesn’t have an extension so Wisej Middleware tries to execute a sub application. Change that line and the mapping will work. Or you can address the handler directly as shown above.
Hi,
here is a test sample that used in video, where i added an another button that set the width of the first column at 300.
if do as in the video, you can see this problem, after button click and change width with mouse, the second click on button don’t change the width visually.
if i first time change with mouse the width, hit one of the button it works, after that when change again with mouse and hit one of buttons is stop works, but, if i hit one button then the other it restart works, i can’t understand where is the problem, and why when i do in the for(columns) loop the column update it didn’t work but in the ColumnWidthChanged Event column update yes.
I hope i have expressed myself well
Hi,
Can you attach a sample?
Thanks.
Hi Marian,
in release 1.4.95 there was a change
| WJ-8932 | New Feature | ApplicationBase.CurrentCulture make setter public |
Before this change you had to add ?lang=<culture> to the URL, something like
ApplicationBase.Navigate(ApplicationBase.Url + “?lang=” + “fr”);
This new feature makes setting the CurrentCulture easier. As you can see on this thread, this should be used like this
Application.CurrentCulture = CultureInfo.GetCultureInfo(“fr”);
Application.Reload(); // needed so Wisej can fetch the resources for the new culture
Hi Frank,
I followed your suggestion and I solved the problem
Thank you very much
Luca,
I’ve attached a simple handler test project which does work in vs, but not in owin.
This is basically the example you gave me a while back.
You’ll see the Wisej.HostService.exe in the project, along with a shortcut. The shortcut is for setting the port and localhost in the arguments.
Thanks
Hi,
i tested and same problem, i registered a little video where show the problem, try to explain: the first time when use the mouse to change the width and after that hit the button it works, but after that (hitting the button) if change again with mouse the width and retray to hit the button it did not works, even if at the code level the width was changed.
I tryed to do DGV Refresh(), Update(), column update and nothing; but yesterday i will found i little solution that it would seem work, intercept the ColumnWidthChange Event, and here do a column Update().
