I have a C1FlexGrid control and that C1Flexgrid control is bound with some data source and now I want to retrieve the data of a particular cell on double click event on a cell. Is there any way to do this?
I try by using
c1FlexGridClassic1_DoubleClick()
but this is not giving me a row number or any value.
I tried this by using CellbuttonClickEvent
, but I don't want this. I want it on the cellDoubleClick event.
public DataRow ReturnSelectedRow { get { return OrderDataRow; } } //This is property is used for transferring data to other form
private void c1FlexGrid1_CellButtonClick(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)
{
if (MessageBox.Show("Do you want to select", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
MessageBox.Show("Selected purchase order" + c1FlexGrid1.Rows[e.Row][1]);
OrderDataRow = OrderData.Rows[e.Row-1];
this.Close();
}
}
Did you read Documentation for flexgrid
?
there is so many samples of various works with flexgrid
here is :
Edited :
use HitTest
to find if a cell is double clicked
void c1FlexGrid1_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
var ht = c1FlexGrid1.HitTest();
if (ht.Row!=-1)
{
MessageBox.Show("Click on row no--" + ht.Row);
//do something
}
}