Skip to main content

TdxNavBarViewsFactory.Names Property

Provides indexed access to the names of registered Views.

Declaration

property Names[AIndex: Integer]: string read;

Property Value

Type
string

Remarks

The AIndex parameter specifies the index of the View whose name is to be obtained. This parameter value can vary from 0 to Count - 1.

The following code populates a combo box with the names of registered NavBar Views and assigns a View to the NavBar control according to the selected name within the combo box. This code can be used to enable end-users to choose a View at runtime:

//...
NavBar: TdxNavBar;
ViewsCombo: TComboBox;
//...
procedure TMainForm.FormCreate(Sender: TObject);
var
  I:Integer;
begin
with dxNavBarViewsFactory do
  begin
    for I := 0 to Count - 1 do
      ViewsCombo.Items.Add(Names[I]);
    ViewsCombo.ItemIndex := 0;
  end;
end;
procedure TMainForm.ViewsComboChange(Sender: TObject);
begin
  NavBar.View := dxNavBarViewsFactory.IDs[TComboBox(Sender).ItemIndex];
end;
//...
See Also