Nested SfListview with group header height issue - Not able to fit the inner list view according to its content.

The inner list appears only if the height is specified for the list view or the parent layout. 
But as the inner list is having different number of the rows the height differs and the space is not filled correctly, resulting in scrolling the content or empty space. 

The requirement is to fit the inner list view according to its content.

This is my second post for the same issue, please reply.

Screenshot and xaml are attached.

Please do reply and if possible provide a sample code with similar functionality.

Attachment: Code_ANd_Screenshots_685f8bc8.rar

3 Replies

MK Muthu Kumaran Gnanavinayagam Syncfusion Team May 30, 2018 04:13 AM UTC

Hi Sadhik, 
 
We have checked the reported requirement and referred the attached Template from our side. We would like to let you know that the ItemSize (both height and width) for each items in View will be got from the respective renderers by passing the desired content(underlying data) as View and layout the measured size as ListViewItem based on ItemIndex in SfListView. We regret to inform you that while measuring the size(both height and width) for the nested SfListView(inner list as one ItemData) as content in respective renderers, the size is measured as 1 because the SfListView content does not contain any data and it uses ScrollView as child. So, both height and width is returned as 1 from the respective renderers and this is the actual behavior. We have also ensured with Xamarin ListView too by using the same scenario with HasUnEvenRows as “true” and behaves as mentioned. To overcome the issue, either you need to define the HeightRequest for each inner SfListView or set the inner SfListView’s AutoFitMode as “Height” and define the ItemSize for outer SfListView. In our sample we have added IEnumerable<string> items in SfListView with the provided template and checked whether the items are loaded in the View. For your reference, we have attached the tested sample and you can download it from the below link.  
  
 
Regards, 
G.Muthu kumaran. 



SA Sadhik replied to Muthu Kumaran Gnanavinayagam May 30, 2018 07:24 AM UTC

Hi Sadhik, 
 
We have checked the reported requirement and referred the attached Template from our side. We would like to let you know that the ItemSize (both height and width) for each items in View will be got from the respective renderers by passing the desired content(underlying data) as View and layout the measured size as ListViewItem based on ItemIndex in SfListView. We regret to inform you that while measuring the size(both height and width) for the nested SfListView(inner list as one ItemData) as content in respective renderers, the size is measured as 1 because the SfListView content does not contain any data and it uses ScrollView as child. So, both height and width is returned as 1 from the respective renderers and this is the actual behavior. We have also ensured with Xamarin ListView too by using the same scenario with HasUnEvenRows as “true” and behaves as mentioned. To overcome the issue, either you need to define the HeightRequest for each inner SfListView or set the inner SfListView’s AutoFitMode as “Height” and define the ItemSize for outer SfListView. In our sample we have added IEnumerable<string> items in SfListView with the provided template and checked whether the items are loaded in the View. For your reference, we have attached the tested sample and you can download it from the below link.  
  
 
Regards, 
G.Muthu kumaran. 


Thank you for clarifying as I thought there was some issue in my xaml. 
I resolved it by defining the HeightRequest (according to the number of rows) for each inner SfListView as you suggested.

Really appreciate your support. Keep up the good work.


MK Muthu Kumaran Gnanavinayagam Syncfusion Team May 31, 2018 05:18 AM UTC

Hi Sadhik, 
 
Thanks for your valuable response. 
 
Regards, 
G.Muthu kumaran. 


Loader.
Up arrow icon