BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
private void button1_Click(object sender, EventArgs e)
{
if (this.sfDataGrid.SelectionController.DataGrid.CurrentCell.ColumnIndex != -1 &&this.sfDataGrid.SelectionController.DataGrid.CurrentCell.RowIndex != -1)
{
var rowIndex = this.sfDataGrid.SelectionController.DataGrid.CurrentCell.RowIndex;
var recordIndex = sfDataGrid.TableControl.ResolveToRecordIndex(rowIndex);
var cellValue = DataGridHelper.GetCellValue(this.sfDataGrid, recordIndex, 2);
MessageBox.Show("Value in cell " + cellValue.ToString());
}
}
public static class DataGridHelper
{
public static object GetCellValue(SfDataGrid sfDataGrid, int recordIndex, intcolumnindex)
{
object cellValue = null;
var record1 = sfDataGrid.View.Records.GetItemAt(recordIndex);
var mappingName = sfDataGrid.Columns[columnindex].MappingName;
cellValue = record1.GetType().GetProperty(mappingName).GetValue(record1, null);
if (cellValue != null)
{
return cellValue;
}
return null;
}
} |