Bug 28575 - listview header set to null
Summary: listview header set to null
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.4.0
Hardware: PC Windows
: Normal major
Target Milestone: ---
Assignee: Rui Marinho
Depends on:
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:

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

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:

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

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};
					_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)

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.

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 Studio ===

Version 5.8.2 (build 7)
Installation UUID: 93e693b0-b53d-40f4-b29c-b61ff5cbe892
	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: (Business Edition)
Hash: 981acb3
Build date: 2015-03-25 14:21:05-0400

=== Xamarin.Android ===

Version: (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: (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 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 
Comment 4 cdetera@computronsoftware.com 2015-10-23 14:45:25 UTC
I am on the Stable channel with the latest of everything (XF  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 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.

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