protected void Toolbar_Click(object sender, Syncfusion.JavaScript.Web.ButtonEventArgs e)
{
var selectedRowIndex = this.Grid1.Model.SelectedRowIndex; // here you will get SelectedRow index
int dataIndex;
if (this.Grid1.PageSettings.CurrentPage > 1)
dataIndex = (this.Grid1.Model.PageSettings.PageSize * (this.Grid1.Model.PageSettings.CurrentPage - 1)) + (selectedRowIndex);
else
dataIndex = selectedRowIndex;
var DataSource = this.Grid1.Model.DataSource;
JavaScriptSerializer mySerialiser = new JavaScriptSerializer();
string sJSONOutput = mySerialiser.Serialize(DataSource);
var data = mySerialiser.Deserialize<IEnumerable<Orders>>(sJSONOutput); // here you will get all the records
var SelectedRow = data.ElementAt(dataIndex); // here you will get SelectedRow
var keyValue = SelectedRow.OrderID; // here you will get selected RowKey value
} |