Bug 12388 - Scrolled event causes GetHeightForRow to not be called
Summary: Scrolled event causes GetHeightForRow to not be called
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 6.3.x
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2013-05-24 13:24 UTC by Pierce Boggan [MSFT]
Modified: 2013-05-24 21:54 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Test case (7.04 KB, application/zip)
2013-05-24 13:25 UTC, Pierce Boggan [MSFT]

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 Pierce Boggan [MSFT] 2013-05-24 13:24:54 UTC
Description of Issue: Whenever the Scrolled event is called, the GetHeightForRow method of UITableView source is not called.
Test project attached.

=== Xamarin Studio ===

Version 4.0.8 (build 2)
Installation UUID: dbb93e30-b525-4632-8fdd-511fbc37c560
	Mono 2.10.12 (mono-2-10/c9b270d)
	GTK 2.24.16
	GTK# (
	Package version: 210120000

=== Apple Developer Tools ===

Xcode 4.6.2 (2067.2)
Build 4H1003

=== Xamarin.Mac ===

Xamarin.Mac: 1.2.43

=== Xamarin.iOS ===

Version: (Business Edition)
Hash: 79bad7e
Build date: 2013-14-05 19:18:45-0400

=== Xamarin.Android ===

Version: 4.6.6 (Business Edition)
Android SDK: /Users/pierceboggan/Library/Developer/Xamarin/android-sdk-mac_x86
	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)
Java SDK: /usr

=== Build Information ===

Release ID: 400080002
Git revision: 0a09117dec1aed78c735ac46f7a50ae7d12f7a7a
Build date: 2013-05-16 19:36:29+0000
Xamarin addins: 78d0437c3f92ae13042f81e5fd9487e2c28d5fbc

=== Operating System ===

Mac OS X 10.8.3
Darwin Macintosh.local 12.3.0 Darwin Kernel Version 12.3.0
    Sun Jan  6 22:37:10 PST 2013
    root:xnu-2050.22.13~1/RELEASE_X86_64 x86_64
Comment 2 Sebastien Pouliot 2013-05-24 21:54:03 UTC
In general mixing ObjC delegates and events is always risky business [1]. It's better to choose one or the other.

What's hapenning is that assigning an event to `Scrolled` creates an internal `UITableViewDelegate` to route the events.

The problem is this internal UITableViewDelegate also supply it's own `GetHeightForRow` [2]. So you're effectively replace the one you set earlier with your `TableSource`.

Why is it in both ? because `UITableViewSource` combines both `UITableViewDataSource` and `UITableViewDelegate`

In this case changing `UITableViewSource` to `UITableViewDataSource` won't help since the `GetHeightForRow` is defined in the *Delegate (same as Scolled). 

[1] http://spouliot.wordpress.com/2012/03/26/events-vs-objective-c-delegates/

[2] is part of both `UITableViewSource` and `UITableViewDelegate`