2

Can anybody help me?

I need to get a text from a cell in the c1flexgrid when I click it. I use this code:

private void CmdSaveCellContent_Executed(EventParameters param)
{
    C1FlexGrid dg = param.Sender as C1FlexGrid;
    Point mp = Mouse.GetPosition(dg);
    HitTestInfo hti = dg.HitTest(mp);
    if (hti.Column == -1 || hti.Row == -1 || dg.Rows.Count <= hti.Row) return;
    var celltext = dg.Cells[hti.Row, hti.Column];

...
}

It works if cell contains text information. But if cell contains Enum, visually I see text, but in the celltext variable I get int value ("0" or "2" for instance).

Sorry for my English

Saranga
  • 3,178
  • 1
  • 18
  • 26
Olejan
  • 183
  • 3
  • 9

1 Answers1

1

Try using the following line of code in the AfterSelChange event of the C1Flexgrid :

MessageBox.Show(Me, "Value of cell " & Me.C1FlexGrid1.Row.ToString() & "/" & Me.C1FlexGrid1.Col.ToString() & ": " & Me.C1FlexGrid1(Me.C1FlexGrid1.Row, Me.C1FlexGrid1.Col).ToString())

Regards, Mohita

Vivek S.
  • 19,945
  • 7
  • 68
  • 85
Mohita
  • 499
  • 3
  • 4