This is by design, the events target the renderer, since the possibility exists for sub-grids and these are all based on the renderer instead. The renderer is the actual grid, the TTMSFNCDataGrid is a wrapper around the renderer. Should you have a need to identify which grid the renderer users, you can use the following code:
function GetGrid(Sender: TObject): TTMSFNCCustomDataGrid;
var
g: TObject;
begin
Result := nil;
if Assigned(Sender) and (Sender is TTMSFNCDataGridRenderer) then
begin
g := (Sender as TTMSFNCDataGridRenderer).Host;
if g is TTMSFNCCustomDataGrid then
Result := g as TTMSFNCCustomDataGrid;
end;
end;
procedure TForm13.TMSFNCDataGrid1CellCheckBoxChange(Sender: TObject; AColumn,
ARow: Integer);
var
g: TTMSFNCCustomDataGrid;
begin
g := GetGrid(Sender);
if Assigned(g) then
begin
//...
end;
end;
If you assign the OnClick for the button, then the Sender will be the button itself, not the grid. The grid doesn’t have any control over what exactly happens with the control. For built-in controls (column control type for example), there is a separate OnCellButtonClick event. If you want to know the grid, you can check the Parent property of the Sender.