Hi Cesar,
This is fundamentally the same problem. A ScrollView on Android will give an infinite canvas for it's children to render, even though they're not visible in the view port.
Solutions
Use a Suitable Parent
Use a parent container that the DataGrid will get a valid measurement from. For example, a Grid:
if you need the Grid to have RowDefinitions, make sure the DataGrid is not in an Auto sized RowDefinition (this also measures to infinity). You can use star-sized or explicit sized RowDefinition safely.
Set Height and Width Request
Set the DataGrid's HieghtRequest and WidthRequest, so that the DataGrid doesn't try to draw all of its content.
If you don't want to accidentally set the size too small, you could always use another element on the page to get the values. For example, you could use the ContentPage's rendered height and width:
This will give the DataGrid the explicit bounds of the page dimensions (you could also point to the ScrollView's size as well)
Summary
Ultimately, the DataGrid has it's own ScrollView in which we carefully optimize the item virtualization (vertical and horizontally) so that the DataGrid only renders the items that are visible (and some items slightly off-screen so that scrolling is seamless).
If you're still having issues, it would be helpful for us to know what the goal is for this specific page and we might be able to come up with a suitable layout that achieves both goals.
Regards,
Lance | Tech Support Engineer, Sr.
Progress Telerik
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Feedback Portal
and vote to affect the priority of the items