Hi Olayinka,
Thank you for contacting Syncfusion Support.
Your requirement can be achieved by customizing the SfDataGrid.CellClick event in SfDataGrid. Please refer the below code snippet,
|
sfDataGrid1.CellClick += SfDataGrid1_CellClick;
private void SfDataGrid1_CellClick(object sender, Syncfusion.WinForms.DataGrid.Events.CellClickEventArgs e)
{
//check the mouse right click
if (e.MouseEventArgs.Button == MouseButtons.Right)
{
//only allow thw record row in SfDataGrid
if (e.DataRow.RowType == Syncfusion.WinForms.DataGrid.Enums.RowType.DefaultRow)
{
//Observable Collection need to type cast the Underline business object
//var record = (e.DataRow.RowData as OrderInfo);
//MessageBox.Show(" OrderID " + record.OrderID + " CustomerID " + record.CustomerID + " CustomerName " + record.CustomerName + " Country " + record.Country + " ShipCity " + record.ShipCity + " IsShipped " + record.IsShipped);
////DataTable collection get the rowdata
var record = (e.DataRow.RowData as DataRowView);
MessageBox.Show(" OrderID " + record.Row[0] + " CustomerID " + record.Row[1] + " CustomerName " + record.Row[2] + " Country " + record.Row[3] + " ShipCity " + record.Row[4]);
}
}
} |
Please let us know if you have any concerns in this.
Regards,
Vijayarasan S