TRichView can not DeleteSelection?
procedure DeleteTable(rve: TCustomRichViewEdit; table: TRVtableitemInfo);
var
RVData: TCustomRVData;
ItemNo: Integer;
begin
RVData := table.Cells[0, 0].GetAbsoluteParentData;
ItemNo := table.GetMyItemNo;
// Table is the ItemNo-th item in RVData.
RVData := RVData.Edit;
TCustomRVFormattedData(RVData).SetSelectionBounds(ItemNo, 0, ItemNo, 1);
rve.DeleteSelection;
end;
How to delete a TRVTableItemInfo from TRichView?
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: How to delete a TRVTableItemInfo from TRichView?
DeleteSelection is an editing operation, so it is available only in editor.
In TRichView, you can use DeleteItems method.
In TRichView, you can use DeleteItems method.
Re: How to delete a TRVTableItemInfo from TRichView?
I insert some controls to the cells, and deleteItems does not work. What's wrong with the code below?
var
table: TRVTableItemInfo;
ItemNo: Integer;
begin
table := FindTable(richView1.RVData, 'mytest1');
ItemNo := table.GetMyItemNo;
richView1.DeleteItems(ItemNo,1);
end;
var
table: TRVTableItemInfo;
ItemNo: Integer;
begin
table := FindTable(richView1.RVData, 'mytest1');
ItemNo := table.GetMyItemNo;
richView1.DeleteItems(ItemNo,1);
end;
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: How to delete a TRVTableItemInfo from TRichView?
Call richview1.Format after DeleteItems.