Is it possible to sum all rows height?

Hello and hope everyone doing well. Is it possible to sum all rows height?

My Listview has not equal rows. I have set AutoFitMode="Height"


3 Replies 1 reply marked as answer

LN Lakshmi Natarajan Syncfusion Team August 31, 2021 01:26 PM UTC

Hi Diogenis, 
 
Thank you for using Syncfusion products. 
 
We have checked the reported query “Is it possible to sum all rows height?” from our side. We would like to inform you that you can get the total height of the SfListView from the TotalExtent value.  
 
Please refer to the following code snippets for more reference, 
public class ExtendedListView : SfListView 
{ 
    VisualContainer container; 
    public ExtendedListView() 
    { 
        container = this.GetVisualContainer(); 
        container.PropertyChanged += Container_PropertyChanged; 
    } 
 
    private void Container_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) 
    { 
        double totalHeight = 0; 
        Device.BeginInvokeOnMainThread(async () => 
        { 
            var extent = (double)container.GetType().GetRuntimeProperties().FirstOrDefault(container => container.Name == "TotalExtent").GetValue(container); 
            if (e.PropertyName == "Height") 
                totalHeight = extent; 
        }); 
    } 
} 
 
Please refer to online documentation to load the ListView with full height, 
 
Please let us know if you need further assistance. 
 
Lakshmi Natarajan 
 


Marked as answer

DC Diogenis Christoforidis replied to Lakshmi Natarajan August 31, 2021 04:35 PM UTC

Thank you very much!! It works like a charm!! I need to make more research about  VisualContainer methods.

Is there any doucumentation about visual container?



LN Lakshmi Natarajan Syncfusion Team September 1, 2021 05:15 AM UTC

Hi Diogenis, 
 
Thank you for the update. 
 
Please refer to our user guidance document regarding the same, 
 
You can also refer to the VisualContainer's API reference in the following link, 
 
Please let us know if you need further assistance. 
 
Regards, 
Lakshmi Natarajan 


Loader.
Up arrow icon