Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9126495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:03:24+00:00 2026-06-17T07:03:24+00:00

Modifying an element using set of a KendoUI grid removes the selection. If a

  • 0

Modifying an element using set of a KendoUI grid removes the selection.

If a have a KendoUI DataSource defined as:

var dataSource = new kendo.data.DataSource({
    data    : [
        { "id": 1, "item": "item1", "value": "foo" },
        { "id": 2, "item": "item2", "value": "foo" },
        { "id": 3, "item": "item3", "value": "foo" },
        { "id": 4, "item": "item4", "value": "foo" }
    ],
    pageSize: 5
});

and the grid as:

var grid = $("#grid").kendoGrid({
    dataSource: dataSource,
    columns   : [
        { field: "item", title: "Item" },
        { field: "value", title: "Value" }
    ],
    selectable: "row"
}).data("kendoGrid");

If I click in a row (select it) and then update the model using the following code:

dataSource.data()[0].set("value", "bar");

The selection gets lost.

Sample code in JSFiddle here

Instructions:

  1. Select any row.
  2. Click the button for changing the value of the first row.

Is there any way of preserving selection when updating a local DataSource?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:03:25+00:00Added an answer on June 17, 2026 at 7:03 am

    This is expected behavior when a change event of the dataSource occurs the Grid reacts and it is redrawn. You can silently update the field like this:

    dataSource.data()[0].value = "bar";
    

    However this will not trigger the change event and the Grid wont be updated either.

    To preserve the selection of the Grid between ‘refreshes’ you can use the approach covered in this code library article. You can store them in a cookie or in the memory, it is up to you.

    Regards

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using defaultdict(set) to populate an internal mapping in a very large data
I have generated a client using Axis2 framework with XMLBeans as the data binding
I have built a one page web application that manipulates a set of data:
(Modifying the question)I have a windows form app in C# which calls into some
Modifying a SnapPages theme, meaning I only have access to the CSS stylesheet. I
I am modifying some code for a Blackfin processor using VisualDSP++ v. 5.0. I
I have two elements on the same page that are using the same stylesheet:
I am using the client_side_validations gem with Rails 3.1.0. I have been trying to
Say I have a mobile web app written using JQuery Mobile, this app retrieves
I have been tasked with modifying the layout of a site so that it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.