Home Forums WinForms controls Xceed Grid for WinForms Need to detect when cell selected and return value Reply To: Need to detect when cell selected and return value

User (Old forums)
Member
Post count: 23064

Try this:<code>// in the constructor, after the call to InitializeComponent
foreach(Cell cell in grid.DataRowTemplate.Cells) cell.Click += new EventArgs(cellClick);
// in a separate method
private void cellClick(object sender, EventArgs e) {
Cell cell = sender as Cell;
if (cell != null) {
object cellValue = cell.Value;
}
}</code>

Imported from legacy forums. Posted by Tommy (had 4150 views)