DeleteElements(Range: ITabRange; [SlotIndex: Integer = -1]);
DeleteElements(Range: Prognoz.Platform.Interop.Tab.ITabRange; SlotIndex: integer = -1);
Range. Table cells range.
SlotIndex. Slot index in the header.
NOTE. The SlotIndex parameters determines in which dimension entering in the header, selection must be changed. If SlotIndex = -1, selection will be changed in the first dimension.
The DeleteElements method removes elements from selection which are in the specified range.
As a value of the Range parameter, the range of headers cells, located in the rows or columns, is required to be determined. On executing the method, dimension elements, displayed in the selected cells, are excluded from the selection of corresponding dimensions.
The method excludes elements of the dimension, which is located in the transferred slot.
The DeleteElements method can be also used to remove calculated elements.
Executing the example requires a form containing the Button component named Button1, the TabSheetBox component named TabSheetBox1 and the UiErAnalyzer component named UiErAnalyzer1. Set UiErAnalyzer1 as a data source for the TabSheetBox1 component.
Set express report as a data source for the UiErAnalyzer1 component. Set the Active property to = True for the UiErAnalyzer1 component.
The procedure is a handler of the OnClick event for the Button1 component.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Eax: IEaxAnalyzer;
Range: ITabRange;
Begin
Eax := UiErAnalyzer1.Instance As IEaxAnalyzer;
Range := TabSheetBox1.Source.GetTabSheet.View.Selection.Range;
Eax.Grid.DeleteElements(Range);
End Sub Button1OnClick;
The data by elements, selected in any header, are excluded from the table when pushing the button.
The requirements and result of the Fore.NET Example execution match with those in the Fore Example. Use Fore.NET analogs instead of Fore components.
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Tab;
…
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
Eax: IEaxAnalyzer;
Range: ITabRange;
Begin
Eax := UiErAnalyzerNet1.AnalyzerUi.Instance As IEaxAnalyzer;
Range := TabSheetBoxNet1.Source.GetTabSheet().View.Selection.Range;
Eax.Grid.DeleteElements(Range, -1);
End Sub;
See also: