Data-bind to Grid selected row.

2 posts, 1 answers
  1. Vincent
    Vincent avatar
    56 posts
    Member since:
    Dec 2013

    Posted 10 Mar 2019 Link to this post

    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.

  2. Answer
    Konstantin Dikov
    Konstantin Dikov avatar
    2466 posts

    Posted 13 Mar 2019 Link to this post

    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:

    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.
Back to Top