Hi,
I have decided to upgrade my projects to Wisej 3.0. But I have found an issue when adding new rows.
I have attached a project to demonstrate the issue.
How to reproduce:
private void buttonAddAChild_Click(object sender, EventArgs e)
{
// Find selected son
Son son = (Son)sonBindingSource.Current;
son.Childs.Add(DataPortal.FetchChild(“added method 1”, true, “Sir”));
}
private void buttonAddAChild2_Click(object sender, EventArgs e)
{
// Find selected son
Son son = (Son)sonBindingSource.Current;
son.Childs.Add(DataPortal.FetchChild(“added method 2”, true, “Sir”));
sonBindingSource.ResetCurrentItem(); //Should not have to call ResetCurrentItem
}
Thanks,
Best regards,
Wilfred
Hi
This was checked for our development team
Isn’t a Wisej issue, indeed the same sample in winforms has similar result
it’s related for a way that windows(and here CSLA) manage IBindingList
Our team worked in an improvement fot Wisej supporting INofifyCollectionChanged (ObservableCollection) that resolve this
limitation
This will be available on the next release 3.0.13 of Wisej.Net
Regards
We removed the change because it created more problems. We tried the nested CSLA data source directly with WPF and it doesn’t work there either.
IBindingList is part of System.ComponentModel (used by winforms) and it’s more flexible that INotifyCollectionChanged (part of System.Collections.Specialized, and used by WPF with a lot of limitations). Neither of those is specific to Winforms or WPF. Wisej.NET now supports both. The problem with your sample is using child BindingSource bound to another child BindingSource and then to another that returns a list from another source CSLA (outside of our control) that mixes things. If we try directly with BindingList<> and ObservableCollection<> it works fine. Our DataGridView (not winforms) is an order of magnitude more integrated with server features and data binding than any other web grid.
We also tried Csla.ApplicationContext.PropertyChangedMode = Csla.ApplicationContext.PropertyChangedModes.Xaml and it seems to work also with child of child, etc. Except it still doesn’t work correctly with plain WPF but it’s not our concerm.
Hi,
I updated to 3.1.1. Looks like the change is gone?
Anyhow, I would rather be using the WPF databinding model. It’s a more modern/better way of doing databinding compared to the ancient WinForms model.
You can instruct CSLA to do this with this code (It is default value so it is actually not needed):
Csla.ApplicationContext.PropertyChangedMode = Csla.ApplicationContext.PropertyChangedModes.Xaml;
And that seems to be working very fine. No problem when adding or deleting rows.
But there is one problem and the reason why I’m using the Windows forms mode. Csla.ApplicationContext.PropertyChangedModes.Windows
Look in this thread:
https://wisej.com/support/question/datagridview-focus-jumps-to-the-first-column-after-editing-a-cell
I think it is the sole reason why I’m using Csla.ApplicationContext.PropertyChangedModes.Windows
I have provided a new sample code. This time it also contains a WinForms project for reference. The WinForms project has all sorts of problems, including the old WinForms DataGridView that no one should be using anymore. But I hope that Wisej is striving to be a better Choice. Not mimicking all problems in WinForms. I use the grid from DevExpress and it handles the problems.
I have also discovered another problem. When you delete all sons. When the last Son i deleted the cildren do not go away. This is also a problem when using Xaml (WPF) mode.
Best regards,
Wilfred
Hi Wilfred,
This issue has been fixed in our latest release, 3.0.14.
Regards,
Levie
Hi
We will check you sample and back to you
regards
Please login first to submit.