Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
- Screencast - http://screencast.com/t/dL6D5Exh1
- Sample App - https://dl.dropboxusercontent.com/u/62849286/Cases/247866/TableViewTest.zip
- Version Info - https://gist.github.com/mattregul/647a0131bc842310903b#file-version-info-cs
When using a Forms TableView on Android. More specifically, EntryCell and TextCell objects that are bound to data sources are not updating when the data source updates. Our specific use case is that we have a button on the page that causes an update of certain data values. When the data source updates, the new values should be reflected in the TableView. However, this is not happening. We have confirmed that the data is being updated in the data source and that a PropertyChanged event is being raised. Note that it works correctly on iOS.
The simplest way to see the problem is when the TableView is located on a modal page. In this case, the cells will never update.
The second way that we have been able to recreate the problem is if the TableView is on a tab within a TabbedPage. In this case, the first time that you switch to the tab, the cells will update correctly. However, if you switch to another tab and then back, the updates will no longer work.
One interesting thing to note is that the values will update when the cells scroll off the screen and back on, or if you switch tabs and back. Presumably this is because the objects are being destroyed and recreated.
One possible workaround is to use ViewCells with Label and Entry objects. These both appear to work correctly. However, this is not an optimal solution because custom renderers would need to be created in order to style to objects correctly for the different platforms.
**Steps to Reproduce:**
Using the Sample App - https://dl.dropboxusercontent.com/u/62849286/Cases/247866/TableViewTest.zip
1. Load App (App loads to the C# demo page)
2. Click the "Generate" button
3. Note that every field on the screen was updated with a random number
4. Mutiple "Generate" clicks will update every field
5. Switch to the XAML tab at the top
6. Click the "Generate" button
7. Note that every field on the screen was updated with a random number
8. Mutiple "Generate" clicks will update every field
9. Switch *back* to the C# tab
10. Click the "Generate" button
11. Note that the Entry fields at the top are no longer updating
12. Switching to the XAML page will reveil the same results
13. Added bonus, check out the "Modal C#"" and "Modal XAML" button at the top of the app, the same loss functinality occurs
Interestingly the cells are updated on the fly the initially on both C# and XAML tabs, but when you change focus and back to that tab they cease to update. (loss of binding?)
**Build Date & Platform:**
- Xamarin.Android - 18.104.22.168
- Xamarin.Forms - 22.214.171.12490
- Full Version List - https://gist.github.com/mattregul/647a0131bc842310903b#file-version-info-cs
Should be fixed in 2.2.0-pre1
I have checked this issue with the XF 126.96.36.199-pre4 and observed that this issue has been fixed and working as expected.
This issue has been fixed hence I am closing this issue.
Enviornment Info: https://gist.github.com/Rajneesh360Logica/7707f4e54c14879b63dc16ef72b6dd01