Hi Tuong Trinh,
Thanks for using Syncfusion Products.
We glad to let you know that we have created a workaround for your requirement. Please refer the below code snippets.
[Default.aspx]
<script type="text/javascript">
$(document).ready(function () {
window.Temp_OnGRMouseUp = window.EG_OnGRMouseUp; //store this event in temp
window.EG_OnGRMouseUp = Custom_OnGRMouseUp; //define custom client side method to prevent selection and saving records on other row selection
});
function Custom_OnGRMouseUp(evt) {
var src = GetEventSrcElement(evt);
if (src.tagName == "TD") {
var td = GetGTCell(src);
if (td == null) {
return;
}
var tr = td.parentNode;
var gridObj = GetEGridObj(tr);
var isCurRow = gridObj.IsCurrentRow(tr);
if (gridObj.GetState() == "Edit") {
if (!isCurRow) {
gridObj.AllowClientSideSelection = false; //prevent client side selection
evt.cancelBubble = true;
return;
}
}
else {
gridObj.AllowClientSideSelection = true;
window.Temp_OnGRMouseUp(evt);
}
}
}
</script>
The above solution can be achieved by overriding the EG_OnGRMouseUp client side method and preventing the client side record selections with postback.
For your convenience, we have prepared a simple sample to demonstrate this and the same can be downloaded from the below link.
Sample: PreventSelection.zip
Please let us know if you have any concerns.
Regards,
Balamurugan A.S