# Reference to RadzenTextBox in RadzenDataGrid

**URL:** <https://forum.radzen.com/t/reference-to-radzentextbox-in-radzendatagrid/10590>\
**Category:** Radzen.Blazor Components\
**Created:** [April 11, 2022, 8:00pm UTC](https://forum.radzen.com/t/reference-to-radzentextbox-in-radzendatagrid/10590 "2022-04-11T20:00:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AHarry](https://forum.radzen.com/user_avatar/forum.radzen.com/aharry/32/4887_2.png) [@AHarry](https://forum.radzen.com/u/AHarry)\
**Post date:** [April 11, 2022, 8:00pm UTC](https://forum.radzen.com/t/reference-to-radzentextbox-in-radzendatagrid/10590/1 "2022-04-11T20:00:06Z")

</div>

If I add an `@ref` variable to a RadzenTextBox in a RadzenDataGridColumn it seems to only point to the textbox of the last row added. If I select a different row the reference variable to the textbox is always the textbox on the last row. Is there a way to reference the textbox on the active row?

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [April 12, 2022, 4:16am UTC](https://forum.radzen.com/t/reference-to-radzentextbox-in-radzendatagrid/10590/2 "2022-04-12T04:16:34Z")

</div>

You should no rely on @ref in repeating components like DataGrid, better use two way binding @bind-Value.

---

<div class="post-metadata">

**Author:** ![AHarry](https://forum.radzen.com/user_avatar/forum.radzen.com/aharry/32/4887_2.png) [@AHarry](https://forum.radzen.com/u/AHarry)\
**Post date:** [April 19, 2022, 1:51pm UTC](https://forum.radzen.com/t/reference-to-radzentextbox-in-radzendatagrid/10590/3 "2022-04-19T13:51:47Z")

</div>

Yes, I am binding to the data value, but I was trying to do my own validation because I prefer not to use inline edit mode. So to shade or highlight an invalid value I would need a reference to the actual element.
