I have tried to get the first PageData on an EPiServer databound PageList through code. When trying to access the datasource for the PageList (<PageListControl>.DataSource as PageDataCollection) I am being return 'null'.
Pages exist and are being returned through the HTML InnerTemplate.
If you are getting the pages by setting the PageLink or PageLinkProperty properties of the control, the DataSource property is null. DataSource is used if you have an enumerable collection of PageDatas that you want to display, not to get the pages the control finds itself using the PageLink.
So if you want to find the first page displayed, you could simply collect the pages yourself in code and set the DataSource property of the control to that collection instead of using PageLink. Because you have the collection you can also easily find the first page.
If you for some reason want to stay with the PageLink auto-binding solution, you can attach an event handler to the Filter event and check in there which page is the first in the collection.
Many thanks Magnus