How would I go about adding a rating control to the FNC Data Grid, for both viewing and editing the cell value?
Since cell controls are permanently visible, you can add a rating control directly to a cell.
TMSFNCDataGrid1.Controls[3, 3] := TMSFNCRating1;
TMSFNCDataGrid1.ControlAligns[3, 3] := gcaClient;
You can bind the event and update the cell value
procedure TForm1.TMSFNCRating1ValueChanged(Sender: TObject; AValue: Single);
begin
TMSFNCDataGrid1.Cells[3 ,3] := AValue;
end;
If you want to do this for a whole column
for I := 1 to TMSFNCDataGrid1.RowCount - 1 do
begin
r := TTMSFNCRating.Create(nil);
r.DataInteger := I;
r.Maximum := 5;
TMSFNCDataGrid1.ManagedObjects[3, I] := r;
TMSFNCDataGrid1.Controls[3, I] := r;
TMSFNCDataGrid1.ControlAligns[3, I] := gcaClient;
end;