Select to view content in your preferred language

Locator control detailed view causing problem

1130
10
Jump to solution
07-26-2023 01:05 AM
JamesAkaes
New Contributor II

Hi,

I am using a locator control in my custom dock pane. But whenever I am using detailed view since result set is now larger the controls below the locator control get pushed more downwards. I tried to set the max height to the locator control due to that result set is inside the scroll viewer but now all the results are not visible and getting cut down (scroll viewer is not scrollable to full extent where we can see all the result sets).

Anyone faced this issue?

This is my UI code

<ScrollViewer VerticalScrollBarVisibility="Auto">
     <Grid>
          <Grid.RowDefinitions>
               <RowDefinition Height="Auto" />
               <RowDefinition Height="Auto" />
               <RowDefinition Height="*" />
         </Grid.RowDefinitions>

         <mappingControls:LocatorControl Grid.Row="0" Margin="3">
              <behaviors:Interaction.Triggers>
                  <behaviors:EventTrigger EventName="SelectedGeocodeResultsChanged">
                       <behaviors:InvokeCommandAction Command="{Binding                   SelectedGeocodeResultsChangedCommand}" PassEventArgsToCommand="True" />
                 </behaviors:EventTrigger>
             </behaviors:Interaction.Triggers>
         </mappingControls:LocatorControl>

         <Label Grid.Row="1" Margin="3" Content="" />

        <StackPanel Grid.Row="2" Margin="6,2">
             <RadioButton Margin="3,3" Content="" />
             <RadioButton Margin="3,3" Content="" />
             <Button Margin="0,20,3,3" HorizontalAlignment="Right" Command="{Binding SearchCommand}" Content="Search" Style="{DynamicResource Esri_Button}" />
       </StackPanel>
  </Grid>

</ScrollViewer>

@Wolf @GKmieliauskas @UmaHarano 

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
CharlesMacleod
Esri Regular Contributor

Move your scroll viewer to be around the locator control and set its Max Height to whatever is your max - eg 400. The Row height for the row containing your control _must be_ Auto not "*".

last, I added an extra row with height="*" that is not used to force the dockpane view to "shrink" when the locator control has no content.

locator_panel.png

 

   <Grid.RowDefinitions>
      <RowDefinition Height="Auto"/><!-- must be Auto -->
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="*" /><!-- extra row with "*" -->
   </Grid.RowDefinitions>
   <!-- move the scroll viewer. set its max height -->
   <ScrollViewer Grid.Row="0" Margin="3" VerticalScrollBarVisibility="Auto" MaxHeight="400">
     <mappingControls:LocatorControl>
       <!-- etc, etc -->
     </mappingControls:LocatorControl>
  </ScrollViewer>
        
   <Label Grid.Row="1" Margin="3" Content="" />

   <StackPanel Grid.Row="2" Margin="6,2">
     <RadioButton Margin="3,3" Content="" />
     <RadioButton Margin="3,3" Content="" />
     <RadioButton Margin="3,3" Content="" />
     <Button Margin="0,20,3,3" HorizontalAlignment="Right" Command="{Binding SearchCommand}" Content="Search" Style="{DynamicResource Esri_Button}" />
  </StackPanel>
</Grid>

 

View solution in original post

0 Kudos
10 Replies
GKmieliauskas
Esri Regular Contributor

Hi,

Does your custom dock pane contain only "ScrollViewer" type control?

If yes, I think, it is enough to have only grid in it:

     <Grid>
          <Grid.RowDefinitions>
               <RowDefinition Height="*" />
               <RowDefinition Height="Auto" />
               <RowDefinition Height="Auto" />
         </Grid.RowDefinitions>

         <mappingControls:LocatorControl Grid.Row="0" Margin="3">
              <behaviors:Interaction.Triggers>
                  <behaviors:EventTrigger EventName="SelectedGeocodeResultsChanged">
                       <behaviors:InvokeCommandAction Command="{Binding                   SelectedGeocodeResultsChangedCommand}" PassEventArgsToCommand="True" />
                 </behaviors:EventTrigger>
             </behaviors:Interaction.Triggers>
         </mappingControls:LocatorControl>

         <Label Grid.Row="1" Margin="3" Content="" />

        <StackPanel Grid.Row="2" Margin="6,2">
             <RadioButton Margin="3,3" Content="" />
             <RadioButton Margin="3,3" Content="" />
             <Button Margin="0,20,3,3" HorizontalAlignment="Right" Command="{Binding SearchCommand}" Content="Search" Style="{DynamicResource Esri_Button}" />
       </StackPanel>
  </Grid>

 

I have change grid row definitions first with last.

Now in ArcGIS Pro GeocodingTools sample it looks like in picture below:

GintautasKmieliauskas_0-1690370289451.png

 

 

0 Kudos
JamesAkaes
New Contributor II

@GKmieliauskas But my radio buttons as well as search button should be next to locator control not at the end.

0 Kudos
JamesAkaes
New Contributor II

@GKmieliauskas And also problem is with the detailed view of the locator control. When there are large results set then below controls are going down and therefore hiding in the UI.

0 Kudos
GKmieliauskas
Esri Regular Contributor

Can you add picture how it must be.

0 Kudos
JamesAkaes
New Contributor II

UIWithoutSearch.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

This should be the UI state when nothing is searched. But when searched and detailed view is selected which will give big result set then then result set should be in scroll viewer. In that case below controls should get pushed downwards which is fine but not so much where those will get hidden.

@GKmieliauskas 

0 Kudos
JamesAkaes
New Contributor II

@GKmieliauskas And this is the problem when opening the detailed view with big result set a scroll viewer will come since i am using that but also the radio buttons and search button will go at the extreme and using scroll viewer we need to see them. I was trying to just to have internal scroll viewer just for locator control's search results.UIWIthDetailedView.png

0 Kudos
CharlesMacleod
Esri Regular Contributor

Move your scroll viewer to be around the locator control and set its Max Height to whatever is your max - eg 400. The Row height for the row containing your control _must be_ Auto not "*".

last, I added an extra row with height="*" that is not used to force the dockpane view to "shrink" when the locator control has no content.

locator_panel.png

 

   <Grid.RowDefinitions>
      <RowDefinition Height="Auto"/><!-- must be Auto -->
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="*" /><!-- extra row with "*" -->
   </Grid.RowDefinitions>
   <!-- move the scroll viewer. set its max height -->
   <ScrollViewer Grid.Row="0" Margin="3" VerticalScrollBarVisibility="Auto" MaxHeight="400">
     <mappingControls:LocatorControl>
       <!-- etc, etc -->
     </mappingControls:LocatorControl>
  </ScrollViewer>
        
   <Label Grid.Row="1" Margin="3" Content="" />

   <StackPanel Grid.Row="2" Margin="6,2">
     <RadioButton Margin="3,3" Content="" />
     <RadioButton Margin="3,3" Content="" />
     <RadioButton Margin="3,3" Content="" />
     <Button Margin="0,20,3,3" HorizontalAlignment="Right" Command="{Binding SearchCommand}" Content="Search" Style="{DynamicResource Esri_Button}" />
  </StackPanel>
</Grid>

 

0 Kudos
JamesAkaes
New Contributor II

@CharlesMacleod Yes I had tried this solution as well but as you can see this way scroll viewer will be till the search box and not only to the search results. 

0 Kudos
CharlesMacleod
Esri Regular Contributor

yes. that is because the results and the search box are part of the same control. unless u write your own control that is how it will look