Back to Devexpress

MapSearchPanelOptions.ShowNullValuePrompt Property

windowsforms-devexpress-dot-xtramap-dot-mapsearchpaneloptions-9f30372e.md

latest3.4 KB
Original Source

MapSearchPanelOptions.ShowNullValuePrompt Property

Gets or sets whether to show a prompt when no request is typed in the search panel.

Namespace : DevExpress.XtraMap

Assembly : DevExpress.XtraMap.v25.2.dll

NuGet Package : DevExpress.Win.Map

Declaration

csharp
[DefaultValue(true)]
public bool ShowNullValuePrompt { get; set; }
vb
<DefaultValue(True)>
Public Property ShowNullValuePrompt As Boolean

Property Value

TypeDefaultDescription
Booleantrue

true if the prompt is shown; otherwise, false.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to ShowNullValuePrompt
MapControl

.SearchPanelOptions .ShowNullValuePrompt

|

Remarks

Use the NullValuePrompt property to define the prompt text.

Example

The following example configures the search panel options such as width, prompt message, and so on:

csharp
using DevExpress.XtraMap;

    private void OnFormLoad(object sender, EventArgs e) {
        // Enable search:
        InformationLayer infoLayer = new InformationLayer();
        mapControl1.Layers.Add(infoLayer);
        BingSearchDataProvider searchProvider = new BingSearchDataProvider();
        infoLayer.DataProvider = searchProvider;
        searchProvider.BingKey = bingKey;

        // Specify search panel options:
        mapControl1.SearchPanelOptions.Visible = true;
        mapControl1.SearchPanelOptions.ShowNullValuePrompt = true;
        mapControl1.SearchPanelOptions.NullValuePrompt = "Type a location to search...";
        mapControl1.SearchPanelOptions.MaxVisibleItemCount = 3;
        mapControl1.SearchPanelOptions.Width = 200;
    }
vb
Imports DevExpress.XtraMap
    Private Sub OnFormLoad(ByVal sender As Object, ByVal e As EventArgs)
        ' Enable search:
        Dim infoLayer As InformationLayer = New InformationLayer()
        mapControl1.Layers.Add(infoLayer)
        Dim searchProvider As BingSearchDataProvider = New BingSearchDataProvider()
        infoLayer.DataProvider = searchProvider
        searchProvider.BingKey = bingKey
        ' Specify search panel options:
        mapControl1.SearchPanelOptions.Visible = True
        mapControl1.SearchPanelOptions.ShowNullValuePrompt = True
        mapControl1.SearchPanelOptions.NullValuePrompt = "Type a location to search..."
        mapControl1.SearchPanelOptions.MaxVisibleItemCount = 3
        mapControl1.SearchPanelOptions.Width = 200
    End Sub

See Also

MapSearchPanelOptions Class

MapSearchPanelOptions Members

DevExpress.XtraMap Namespace