Every visual element in Xceed Grid for WinForms behaves as if it were a separate control. This means that each of these elements can raise the mouse and keyboard events separately and you can therefore handle these events without having to write code to check which object has raised the event.
When dealing with mouse and keyboard events, once there are rows in the grid, if these rows contain cells, it is the cells that will raise the mouse and keyboard events. If the row does not have cells, then it is the row that will raise the events. With the mouse and keyboard events, it is easier to think of the grid as a panel containing "child" rows which in turn contain "child" cells.
You won't get mouse and keyboard events directly from the grid once it contains data, therefore you will need to subscribe to the Click event of each cell of the DataRowTemplate.
VB.NET | Copy Code |
---|---|
GridControl1.BeginInit() GridControl1.DataSource = DataSet11 |
C# | Copy Code |
---|---|
gridControl1.BeginInit(); gridControl1.DataSource = dataSet11; |
You can also do this in the Grid Designer (C#), by selecting all the cells on the DataRowTemplate (hold Shift and click on every cell), and entering an event handler in the property grid for the Click event.