I am using an editor template to provide custom behavior in my grid when a user edits a record. The editor template .cshtml file is as follows:
@model string
@Html.TextBoxFor(s => s, new { id ="gradingSubItemGrade", @class="k-textbox" })
<script type="text/javascript">
$(document).ready(function () {
$('#gradingSubItemGrade').bind('keypress', function (e) {
if (e.keyCode == 13) {
var barcode = e.currentTarget.value;
GetJSON('/API/CoinReferenceInformation/ByBarcode?barcode=' + barcode,
function (data) {
$('#gradingSubItemGrade').val(data.Grade + data.GradeNumber);
},
function () { });
}
});
})
</script>
As you can probably see from the code sample, I am trying to send the text of the TextBox to a service (when [Enter] is pressed), then, upon receiving a response, override it with the results.
This almost works...the response comes back correctly, and the results are displayed in the TextBox. However, what is saved is what the user entered, not what is returned by the service.
Are there additional steps I need to do to notify the grid that the text has changed?
Sorry, I found my answer a few posts below here