Bug 28575 - listview header set to null
Summary: listview header set to null
Status: RESOLVED ANSWERED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms (show other bugs)
Version: 1.4.0
Hardware: PC Windows
: Normal major
Target Milestone: ---
Assignee: Rui Marinho
URL:
Depends on:
Blocks:
 
Reported: 2015-03-31 01:54 UTC by Alessandro
Modified: 2018-01-03 19:46 UTC (History)
9 users (show)

Tags: all listview AC
Is this bug a regression?: ---
Last known good build:


Attachments
Test Sample (4.66 MB, application/zip)
2015-04-01 06:41 UTC, Abhishek
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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.

Related Links:
Status:
RESOLVED ANSWERED

Description Alessandro 2015-03-31 01:54:21 UTC
Hi

I've this code

				if(App.ListaSoggetti == null)
					_listView.Header = new Label() {
					Text="Nessun dato", 
					XAlign = TextAlignment.Center,
					FontSize = Library.GetFontNamedSize(NamedSize.Large, typeof(Label)),
					HorizontalOptions = LayoutOptions.CenterAndExpand};
				else
					try{
					_listView.Header = null;
				}
				catch(Exception ex){
					DisplayAlert("Errore", ex.Message, "Ok");
				}

I want to have the header only if I have the ListaSoggetti == null.
Otherwise I don't want header.
_listView.Header = null; freeze the app.

I can't use _listView.Header = "" because the header is still visible (empty but visible)

Thanks
Comment 1 Abhishek 2015-04-01 06:41:43 UTC
Created attachment 10583 [details]
Test Sample

I have tried this issue and able to reproduce the reported behavior at my end.

Steps To reproduce :
1. Create a Xamarin.Forms (PCL) application.
2.  Add Content Page to the solution. 
3.  Add button to the content page and on button click set the listview.Header=null.
4.  Run the Application on the IOS Device/Simulator.
5  Click on"Click "Button . it will display the alert message"Object reference is   not set to the instance of the object" 
6. Run the same application on the Android Device/Emulator .
7. Click on"Click" Button .It will freeze the application.

Screencast:http://www.screencast.com/t/a8l1pg4Fq
Application Output:https://gist.github.com/Abhishekk360/c42d29053ce89fa47640
Android Device Log: https://gist.github.com/Abhishekk360/266f79dc796046629e10
IDE log: https://gist.github.com/Abhishekk360/a4c9a625150161ec70c9

Environment Info:

Xamarin.Forms: 1.4.1.6349,1.4.2.6353-pre2
=== Xamarin Studio ===

Version 5.8.2 (build 7)
Installation UUID: 93e693b0-b53d-40f4-b29c-b61ff5cbe892
Runtime:
	Mono 3.12.1 ((detached/0849ec7)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312010003

=== Apple Developer Tools ===

Xcode 6.2 (6776)
Build 6C131e

=== Xamarin.iOS ===

Version: 8.8.2.4 (Business Edition)
Hash: 981acb3
Branch: 
Build date: 2015-03-25 14:21:05-0400

=== Xamarin.Android ===

Version: 4.20.1.0 (Business Edition)
Android SDK: /Users/xamarin23/Desktop/android-sdk-macosx
	Supported Android versions:
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

=== Xamarin Android Player ===

Version: Unknown version
Location: /Applications/Xamarin Android Player.app

=== Xamarin.Mac ===

Version: 2.0.0.175 (Business Edition)

=== Build Information ===

Release ID: 508020007
Git revision: 067ed06873402cf780f8a0899bb332c2a1c0af22
Build date: 2015-03-27 14:17:13-04
Xamarin addins: 02510c4990dee3475c282b3182d588975a63ff07

=== Operating System ===

Mac OS X 10.10.0
Darwin 800BC.local 14.0.0 Darwin Kernel Version 14.0.0
    Fri Sep 19 00:26:44 PDT 2014
    root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64
Comment 2 Rui Marinho 2015-06-15 14:00:48 UTC
Should be fixed in 1.4.3 final.
Comment 3 Parmendra Kumar 2015-06-16 13:03:46 UTC
I have checked this issue with Xamarin.Forms 1.4.3.6364-pre3 and its working
fine at my end.

Hence closing this issue.


Environment info:

Microsoft Visual Studio Professional 2013
Version 12.0.30723.00 Update 3
Microsoft .NET Framework
Version 4.5.51641

Xamarin   3.11.590.0 
Xamarin.Android   5.1.3.1 
Xamarin.iOS   8.10.1.0
Comment 4 cdetera@computronsoftware.com 2015-10-23 14:45:25 UTC
I am on the Stable channel with the latest of everything (XF 1.5.1.6471).  Can you give me an idea as to when this fix will be released on the Stable channel?  Thanks!
Comment 5 Parmendra Kumar 2015-10-23 15:32:45 UTC
@cdetera, This issue has been fixed and I have again checked with latest stable build 1.5.1.6471. and I am not getting this issue with latest stable.

Screencast: http://www.screencast.com/t/6fjepUOoq

Please follow the screencast and filed a separate issue if you getting different behavior.

Thanks.!
Comment 6 E.Z. Hart [MSFT] 2017-11-01 17:48:15 UTC
Works fine on iOS and Android, does not work on UWP desktop.
Comment 7 Paul DiPietro [MSFT] 2018-01-03 19:46:22 UTC
Migrated to https://github.com/xamarin/Xamarin.Forms/issues/1493 for future tracking