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.
Unfortunately, activation email could not send to your email. Please try again.

For Info: DoubleClick event on very last row fails

Thread ID:

Created:

Updated:

Platform:

Replies:

105432 Oct 12,2012 04:44 AM Nov 29,2012 05:55 AM ASP.NET MVC (Classic) 5
loading
Tags: Grid
John Hind
Asked On October 12, 2012 04:44 AM

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


Rakesh D [Syncfusion]
Replied On October 16, 2012 08:57 AM

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

Administrator [Syncfusion]
Replied On November 23, 2012 08:23 AM

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);
}
}


John Hind
Replied On November 23, 2012 12:06 PM

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

regards,

John


Administrator [Syncfusion]
Replied On November 24, 2012 07:45 AM

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


Rakesh D [Syncfusion]
Replied On November 29, 2012 05:55 AM

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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;