Frequently Asked Component Specific Questions
Options |
Display all FAQ items |
Displaying items 1 to 1 of 1, page 1 of 1
<< previous next >>
TMS FNC UI Pack
TTMSFNCGrid: Using a TTMSFNCRichEditor as inplace editor for the TTMSFNCGrid
TTMSFNCGrid: Using a TTMSFNCRichEditor as inplace editor for the TTMSFNCGrid
It’s quite straightforward to use the TTMSFNCRichEditor as inplace editor for the grid. In the grid cell, you can display HTML formatted text and this can then be wysiwyg edited with TTMSFNCRichEditor.
All that is needed is to implement a few event handlers. Via OnGetCellEditorType, it is defined that a custom inplace editor should be used:
procedure TForm5.TMSFNCGrid1GetCellEditorType(Sender: TObject; ACol, ARow: Integer; var CellEditorType: TTMSFNCGridEditorType); begin CellEditorType:= etCustom; end;
procedure TForm5.TMSFNCGrid1GetCellEditorCustomClassType(Sender: TObject; ACol, ARow: Integer; var CellEditorCustomClassType: TTMSFNCGridEditorClass); begin CellEditorCustomClassType := TTMSFNCRichEditor; end;
procedure TForm5.TMSFNCGrid1GetCellEditorProperties(Sender: TObject; ACol, ARow: Integer; CellEditor: TWinControl); begin TMSFNCRichEditorFormatToolBar1.RichEditor := (CellEditor as TTMSFNCRichEditor); end;
procedure TForm5.TMSFNCGrid1CellEditGetData(Sender: TObject; ACol, ARow: Integer; CellEditor: TWinControl; var CellString: string); begin TMSFNCRichEditorHTMLIO1.RichEditor := (CellEditor as TTMSFNCRichEditor); TMSFNCRichEditorHTMLIO1.LoadHTML(CellString); end; procedure TForm5.TMSFNCGrid1CellEditSetData(Sender: TObject; ACol, ARow: Integer; CellEditor: TWinControl; var CellString: string); begin CellString := (CellEditor as TTMSFNCRichEditor).ContentAsHTML(''''); end;