diff --git a/knowledge-base/grid-nullreferenceexception-gridrowcollection.md b/knowledge-base/grid-nullreferenceexception-gridrowcollection.md new file mode 100644 index 000000000..2b75e4fa9 --- /dev/null +++ b/knowledge-base/grid-nullreferenceexception-gridrowcollection.md @@ -0,0 +1,56 @@ +--- +title: NullReferenceException for GridRowCollection +description: How to fix a null reference exception thrown for the GridRowCollection property of the Telerik Blazor Grid. +type: troubleshooting +page_title: NullReferenceException for the Grid GridRowCollection +slug: grid-kb-nullreferenceexception-gridrowcollection +position: +tags: +ticketid: 1643250, 1642910, 1604815, 1574971, 1577863, 1580684 +res_type: kb +--- + +## Environment + + + + + + + +
ProductGrid for Blazor
+ + +## Description + +I upgraded the version of the Telerik UI from Blazor components and I get a `NullReferenceException` from the `GridRowCollection` class. + +## Error Message + +```` +Error: System.NullReferenceException: Object reference not set to an instance of an object. +at Telerik.Blazor.Components.Grid.GridRowCollection`1.BuildRenderTree(RenderTreeBuilder __builder) +```` + +## Cause + +The Telerik UI Grid for Blazor throws a `NullReferenceException` for the `GridRowCollection` property when using both the `Data` parameter and `OnRead` event handler: + +
+ +````CSHTML + + +```` + +## Solution + +Remove either the `Data` parameter or the `OnRead` event handler. + +## See Also + +* [Changes in the `OnRead` event in version 3.0]({%slug changes-in-3-0-0%}#onread) +* [Common `OnRead` event documentation]({%slug common-features-data-binding-onread%}) +* [How to provide data to Telerik Blazor components]({%slug common-features-data-binding-overview%}#how-to-provide-data) +