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
Solved! Go to Solution.
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.
<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>
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:
@GKmieliauskas But my radio buttons as well as search button should be next to locator control not at the end.
@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.
Can you add picture how it must be.
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 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.
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.
<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>
@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.
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