0

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.

Code

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();
    }
}
Community
  • 1
  • 1
Milind
  • 437
  • 2
  • 9
  • 23

1 Answers1

0

Did you read Documentation for flexgrid?

there is so many samples of various works with flexgrid

here is :

Flex Pdf Documentation

Flex Online Documentation

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
        }
    }
Community
  • 1
  • 1
Arash
  • 3,013
  • 10
  • 52
  • 74
  • Yes i Read all documentation before posting this question but i had not found any solution o it – Milind Feb 02 '13 at 07:19
  • `HitTest(e)` Method is not accepting Parameter e . Error occurs invalid argument – Milind Feb 02 '13 at 08:36
  • Wow it works but i only use `HitTest()` Method without any argument `var ht = c1FlexGrid1.HitTest();` `if (ht.Row!=-1)` `{` `MessageBox.Show("Click on row no--" + ht.Row);` `}` – Milind Feb 02 '13 at 08:40