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.
Syncfusion Feedback

Reading cell values client-side

Thread ID:

Created:

Updated:

Platform:

Replies:

102657 Feb 17,2012 09:28 AM Mar 1,2012 12:21 PM ASP.NET MVC (Classic) 5
loading
Tags: Grid
Mark Treveil
Asked On February 17, 2012 09:28 AM

Dumb question, if I may?

Is it possible to in client side Javascript to get hold of the value of a specific cell. For example, if I wanted the contents of first cell of row 5?

I know you can get row data in client side event functions such as OnRecordSelectionEvent, but this only the row that has been clicked.

If I, say, want to then look at all the other selected rows in the same function, can I do that? I can see which rows are selected via gridObj._selectionManager.selectedRowsCollection, but how would I get their cell contents?

Thanks
Mark


Bala Murugan A.S [Syncfusion]
Replied On February 21, 2012 01:46 AM

Hi Mark,

Thanks for using Syncfusion Products.

We glad to inform you that we have achieved your requirement. Please refer the below code snippet.

[javascript]

gridObj = $find("Grid1");
//Selected Row's object
var selectedRows = gridObj.selectedRows();

/*here you can get any selected row's cell value from selectedRows object (gridObj.selectedRows()) collection by specifying the rowIndex and cellIndex.*/
//0 -rowIndex, 5-cellIndex
var value = selectedRows[0].cells[5].innerHTML;



For your convenience, we have prepared a simple sample to demonstrate this and same can be downloaded from the below link.

SelectedRows1395894463.zip

Note: selectedRowsCollection gives only the array of indexes of the selected rows.

Please try the above sample and let us know if you need further assistance.

Regards,
Bala Murugan A.S


Mark Treveil
Replied On February 21, 2012 05:23 AM

Cool! I'll give it a go.

Mark


Bala Murugan A.S [Syncfusion]
Replied On February 21, 2012 10:43 PM

Hi Mark,

Thanks for the update.

We will wait for your response.

Regards,
Bala Murugan A.S


Mark Treveil
Replied On February 29, 2012 04:50 AM

Yep, works a treat.
Thanks
Mark


Bala Murugan A.S [Syncfusion]
Replied On March 1, 2012 12:21 PM

Hi Mark,

Thanks for the update.

Please let us know if you need futher assistance.

Regards,
Bala Murugan A.S


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.

Warning Icon 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.Close Icon

;