Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TdxNavBarViewsFactory.Names Property

Provides indexed access to the names of registered Views.

#Declaration

Delphi
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:

Delphi
//...
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