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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

get value

Thread ID:

Created:

Updated:

Platform:

Replies:

126317 Oct 6,2016 11:36 PM UTC Oct 7,2016 04:56 AM UTC Xamarin.Forms 1
loading
Tags: SfDataGrid
Miguel Arenas
Asked On October 6, 2016 11:36 PM UTC

Hi to all, 
How can I get a value of specific row, specific column?


Divakar Subramaniam [Syncfusion]
Replied On October 7, 2016 04:56 AM UTC

Hi Miguel, 
 
 
Thanks for contacting Syncfusion Support. 
 
 
In SfDataGrid, it is possible to get the value of specific row and specific column using SfDataGrid.GetCellValue(RowData,ColumnName) method by passing row data and column name as parameters. Please refer the below code snippet to know how to get the cell value of each rows and columns. 
 
foreach (var row in sfGrid.View.Records) 
{ 
    foreach (var column in sfGrid.Columns) 
    { 
        //Get the cell value of each column 
        var getCellValue = sfGrid.GetCellValue(row.Data, column.MappingName); 
    } 
} 
 
  
 
You can also get the cell value for the specific column and row as follows. 
 
foreach (var column in sfGrid.Columns) 
{ 
    //Get the cell value of specific row and column 
    if (column.MappingName == "OrderID") 
    { 
        var rowData = sfGrid.GetRecordAtRowIndex(2); 
        var getCellValue = sfGrid.GetCellValue(rowData, column.MappingName); 
    } 
} 
 
 
We have prepared the sample based on your query and you can download the same from the below link. 
 
 
 
 
 
Regards, 
Divakar, 
 


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

;