# Select a row in code - DataGrid

**URL:** <https://forum.radzen.com/t/select-a-row-in-code-datagrid/5324>\
**Category:** Radzen.Blazor Components\
**Created:** [October 19, 2020, 8:21am UTC](https://forum.radzen.com/t/select-a-row-in-code-datagrid/5324 "2020-10-19T08:21:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martin-Andersen](https://forum.radzen.com/user_avatar/forum.radzen.com/martin-andersen/32/4492_2.png) [@Martin-Andersen](https://forum.radzen.com/u/Martin-Andersen)\
**Post date:** [October 19, 2020, 8:21am UTC](https://forum.radzen.com/t/select-a-row-in-code-datagrid/5324/1 "2020-10-19T08:21:56Z")

</div>

Are there a way to select a row in the grid in code?  
I want to add an item to the datagrids datasource and then set the then select row to the new item.
