Select to view content in your preferred language

How to add Input for "Select date" in Add-in Module (ArcGIS pro sdk)?

643
2
Jump to solution
11-16-2022 02:36 AM
TayyabMir
New Contributor

Hi,
I'm new to ArcGIS pro sdk. I have followed the basic tutorials and I want something similar to the Edit Attribute Data Addin but instead of the EditBox (ArcGIS.Desktop.Framework.Contracts.EditBox), I would like to input a date-picker so the user can select a date.

TayyabMir_0-1668594813834.png

 

My add-in basically needs a "Start-date" and "End-date" input fields to go further.

I couldn't find anything for inputting date in the API reference. Any help or suggestions?

 

0 Kudos
1 Solution

Accepted Solutions
GKmieliauskas
Esri Regular Contributor

Hi,

Check TimeNavigation esri community sample. It uses from and start date controls.

  <Grid Height="66">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <TextBlock Grid.Row="0" Grid.Column="0" Text="Start Time:" VerticalAlignment="Center" Padding="5,0,5,0"/>
        <TextBlock Grid.Row="1" Grid.Column="0" Text="End Time:" VerticalAlignment="Center" Padding="5,0,5,0"/>
        <DatePicker Grid.Row="0" Grid.Column="1" SelectedDate="{Binding Path=StartDate, Mode=TwoWay}" VerticalAlignment="Center"/>
        <DatePicker Grid.Row="1" Grid.Column="1" SelectedDate="{Binding Path=EndDate, Mode=TwoWay}" VerticalAlignment="Center"/>
    </Grid>

View solution in original post

2 Replies
GKmieliauskas
Esri Regular Contributor

Hi,

Check TimeNavigation esri community sample. It uses from and start date controls.

  <Grid Height="66">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <TextBlock Grid.Row="0" Grid.Column="0" Text="Start Time:" VerticalAlignment="Center" Padding="5,0,5,0"/>
        <TextBlock Grid.Row="1" Grid.Column="0" Text="End Time:" VerticalAlignment="Center" Padding="5,0,5,0"/>
        <DatePicker Grid.Row="0" Grid.Column="1" SelectedDate="{Binding Path=StartDate, Mode=TwoWay}" VerticalAlignment="Center"/>
        <DatePicker Grid.Row="1" Grid.Column="1" SelectedDate="{Binding Path=EndDate, Mode=TwoWay}" VerticalAlignment="Center"/>
    </Grid>
TayyabMir
New Contributor

Perfect! Thanks for the quick response

0 Kudos