This is a migrated thread and some comments may be shown as answers.

Data-bind to Grid selected row.

1 Answer 338 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vincent
Top achievements
Rank 1
Iron
Vincent asked on 10 Mar 2019, 12:04 PM

I have grid and several textarea in a page. I want to bind the textarea “value” attribute to the gird's selected row(a column). when the gird change the selected row, the textarea value change. and change the text of textarea, the grid content change.

how can i get it.

I am trying to bind in grid change event, but when I change the textarea value, the selected row disappeared.

1 Answer, 1 is accepted

Sort by
0
Accepted
Konstantin Dikov
Telerik team
answered on 13 Mar 2019, 01:44 PM
Hi Vincent,

If you are using the "data-bind" attribute in combination with the "kendo.bind" method to make two-way binding between the selected dataItem and the textarea, note that each change in the textarea will trigger the change event of the Grid's DataSource, which will refresh the data of the Grid, clearing the selection. In order to handle this, you could define the "id" of in "schema.model" (in the dataSource) and enable the "persistSelection" of the Grid. For your convenience, following is a dojo example demonstrating that approach:

Regards,
Konstantin Dikov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Vincent
Top achievements
Rank 1
Iron
Answers by
Konstantin Dikov
Telerik team
Share this question
or