We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

For Info: DoubleClick event on very last row fails

If you are picking up the ClientSideDoubleClickEvent, the call will return the incorrect data if you double click the very last row.

Your Grid has:-

.ClientSideDoubleClickEvent("DoubleClick")

Your view has:-

<script type="text/javascript">

function DoubleClick(sender, args) 
{
    alert(args.record.CURRENT_VALUE);
 };
</script>

 

*** This fix, provided by tech support, is to put this function in your site.master file.  ****

<script type="text/javascript">

 $(function () {
     Syncfusion.Mvc.Grid.SelectionEventArgs = function (selected, visibleColumns, colObj) {
 
   this.row = selected.row;
  this.colObj = colObj;
  this.record = {};
  this.hoverEventArgs = selected.hoverEventArgs;

  if ($(this.row).find('form').length > 0) {
      for (var i = 0; i < visibleColumns.length; i++) {
   this.record[visibleColumns[i]] = $("#" + visibleColumns[i].Name).val();
      }
  }
  else {
      for (var i = 0; i < visibleColumns.length; i++) {
   this.record[visibleColumns[i]] = $($(this.row).find('td.RowCell'))[i].innerHTML;
      }
  }
     }
 });
</script>

John


5 Replies

RD Rakesh D Syncfusion Team October 16, 2012 12:57 PM UTC

Hi John hind,

Thanks for your update.

We are glad to know that your issue has been resolved. Please let us know if you have any other concerns so that we will be happy to help you out.

Regards,
Rakesh D


AD Administrator Syncfusion Team November 23, 2012 01:23 PM UTC

I am also facing the same issue.
after putting the given piece of code, data is coming in wrong fashion for record in the last row.
i.e. suppose i have 3 cols 1) ID, 2) Name 3) Text
I am getting value in ID's column is reported for Name field in record, 
value in Name's column is reported for Text field in record, and some dummy data is coming for col ID.

I am putting the way i am populating the grid view.
Please let me know if i did any thing wrong.

FYI: Model Editable Data is having three properties, int ID, string Name, string Text.

Html.Syncfusion().Grid<EditableData>("_DataGrid")
.Datasource(Model)
.Column(column =>
{
column.Add(a => a.Id).HeaderText("Id").Width(50);
column.Add(a => a.Name).HeaderText("Name").Width(150);
column.Add(a => a.Text).HeaderText("Text").Width(150);
})
.AllowSearching(true)
.EnableFiltering()
.SelectionMode(SelectionMode.Single)
.Scrolling(scroll =>
{
scroll.AllowScrolling(true);
})
.ToolBar(tool =>
{
tool.Add(GridToolBarItems.Search);
})
.Editing(edit =>
{
edit.PrimaryKey(key => key.Add(p => p.Id));
})
.ClientSideRecordSelectionEvent("ClientSideRecordSelection")
.Render();

and java script code as

function ClientSideRecordSelection(sender, args) {
if (args.record != undefined) {
var disp = "ID: " + args.record.Id + ", ";
disp += "Name: " + args.record.Name + ", ";
disp += "Text: " + args.record.Text + ", ";
alert(disp);
}
}



JH John Hind November 23, 2012 05:06 PM UTC

Are you using the latest version of the Grid 10.4.0.53 ? The issue has been fixed.

regards,

John



AD Administrator Syncfusion Team November 24, 2012 12:45 PM UTC

Hi John,

No i am not using 10.4 yet,
Let me update to latest version and check this.
Thanks for your inputs.

Regards,
Naveen



RD Rakesh D Syncfusion Team November 29, 2012 10:55 AM UTC

Hi Naveen,

 

Thank you for using Syncfusion products.

 

Query: Data is coming in wrong fashion for record in the last row.

 

We have fixed this issue in our latest Essential Studio Version “10.4.0.53”. We suggest you to upgrade your Essential Studio to our latest Version. The latest version can be downloaded from the following link.

https://www.syncfusion.com/downloads/latest-version

Please let us know if you have any other concerns so that we will be happy to help you out.

 

Regards,

Rakesh D


Loader.
Live Chat Icon For mobile
Up arrow icon