Select to view content in your preferred language

hide and open Column Definition

1503
5
02-22-2011 08:08 AM
JayKappy
Frequent Contributor
I have a central window that contains my map. I then added a column that displays results next to my map, but not in the maps view. sort of like a TOC
Everything works fine but I am looking to hide this TOC until I run the query. Cant seem to figure this out....

I can hide the listbox and turn it on....but cant seem to hide the column itself...
Any thoughts?

                <Grid Grid.Row="2">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="275"/>
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>

                    <Grid Name="MainStackColumn" >
                        <StackPanel x:Name="MainStack" Height="600" Width="300" Orientation="Vertical" Margin="0,0,0,0" HorizontalAlignment="Left">
                            <StackPanel x:Name="IdentifyResultsPanelBufferIncidents_Police" Height="300" Width="300" Orientation="Vertical" Margin="0,0,0,0" HorizontalAlignment="Center">
                            </StackPanel>
                            <StackPanel x:Name="IdentifyResultsPanelBufferIncidents_Police2" Height="300" Width="300" Orientation="Vertical" Margin="0,0,0,0" HorizontalAlignment="Center">
                            </StackPanel>
                        </StackPanel>
                    </Grid>

                    <Grid>
                        <!-- THIS IS WHERE THE MAP IS-->                    
                   </Grid>
                </Grid>
0 Kudos
5 Replies
JayKappy
Frequent Contributor
maybe a Grid.RenderTransform?  I can hide the grid and then show the listboxes....but the Grid and its 275 width are still visiable...
I want this to open and not interfear with the map column next to it....?????

            <Storyboard x:Name="HideMainStackPoliceList" >
                <DoubleAnimation Duration="0:0:0.5" BeginTime="0:0:0" Storyboard.TargetName="MainStackScaleTransform" Storyboard.TargetProperty="ScaleX" To="0" />
                <DoubleAnimation Duration="0:0:0.5" BeginTime="0:0:0" Storyboard.TargetName="MainStackScaleTransform" Storyboard.TargetProperty="ScaleY" To="0" />
                <DoubleAnimation Duration="0:0:0.5" BeginTime="0:0:0.5" Storyboard.TargetName="MainStack" Storyboard.TargetProperty="Height" To="0" />
            </Storyboard>
            <Storyboard x:Name="ShowMainStackPoliceList" >
                <DoubleAnimation Duration="0:0:0.5" BeginTime="0:0:0" Storyboard.TargetName="MainStack" Storyboard.TargetProperty="Height" To="600" />
                <DoubleAnimation Duration="0:0:0.5" BeginTime="0:0:0" Storyboard.TargetName="MainStack" Storyboard.TargetProperty="Width" To="300" />
                <DoubleAnimation Duration="0:0:0.5" BeginTime="0:0:0.5" Storyboard.TargetName="MainStackScaleTransform" Storyboard.TargetProperty="ScaleX" To="1" />
                <DoubleAnimation Duration="0:0:0.5" BeginTime="0:0:0.5" Storyboard.TargetName="MainStackScaleTransform" Storyboard.TargetProperty="ScaleY" To="1" />
            </Storyboard>
       
<Grid Grid.Row="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="275"/>
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Grid Name="MainStackColumn" Grid.Column="0" RenderTransformOrigin=" 0.0,0.0">                
                <Grid.RenderTransform>
                    <ScaleTransform x:Name="MainStackScaleTransform" ScaleX="0" ScaleY="0" />
                </Grid.RenderTransform>
                <StackPanel x:Name="MainStack" Height="600" Width="300" Orientation="Vertical" Margin="0,0,0,0" HorizontalAlignment="Left">
            </Grid>
            <Grid Grid.Column="1">
            </Grid>

0 Kudos
JenniferNery
Esri Regular Contributor
0 Kudos
JayKappy
Frequent Contributor
Yes i Have been referencing that and others in my code....but gettign confused...this is what I have...I have a main grid composed of sub grids to form the layout of my page

Its the MAP GRID that I am having problems with...right now I have 2 grids in it being displayed side by side...and was trying to hide the left grid and then turn it on...

If I understand you correctly you are saying to remove the two grids inside the MAP GRID and use a StackPanel to control the uncollapsing and collapsing????

The big thing is that I dont want the results panel that is opening to open over the map...I want it off to the side...

    <Grid x:Name="LayoutRoot" Background="{StaticResource BaseColor}">
        <Grid.RowDefinitions>
            <RowDefinition Height="50" />   <!-- Header 1      --> 
            <RowDefinition Height="25" />  <!-- Menu Bar      --> 
            <RowDefinition Height="*"  /> <!-- MAP           --> 
            <RowDefinition Height="5" /> <!-- Grid Splitter --> 
            <RowDefinition Height="5" /> <!-- Data Grid     --> 
            <RowDefinition Height="5" /> <!-- Blank         --> 
        </Grid.RowDefinitions>

        <Grid Grid.Row="0">
               <!-- Application Header -->
        </Grid>

        <Grid Grid.Row="1" 
               <!--Menu bar-->
        </Grid>

        <Grid Grid.Row="2">

              <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="Auto"/>
                  <ColumnDefinition Width="*" />
              </Grid.ColumnDefinitions>

              <Grid Grid.Column="0">
                     <!-- TOC showing results -->
              </Grid>

              <Grid Grid.Column="1">
                     <!-- MAP -->
              </Grid>
       
        <basics:GridSplitter Grid.Row="3" HorizontalAlignment="Stretch">
              <!-- Grid spliter -->
        </basics:GridSplitter> 
     
        <Grid Grid.Row="4">
             <!-- FeatureDataGrid-->
        </Grid>

        <Grid Grid.Row="5">
        </Grid>
0 Kudos
JayKappy
Frequent Contributor
Think I got it....will show what I did....
0 Kudos
JayKappy
Frequent Contributor
If you look at my last post you will see the format I used to create my main screen in my app...the problem was in Grid.Row="2"

I was trying to find a way to expand and collapse a TOC which has results from a query sent to it...
This is what I did

Thank you Jennifer for pointing out the similarities with the other post....Think I was ust missing the second Grid.ColumnDefinition

Thanks Again

<Grid Grid.Row="2">

      <Grid.ColumnDefinitions>
           <ColumnDefinition Width="Auto"/>
           <ColumnDefinition Width="*" />
      </Grid.ColumnDefinitions>

             <Grid Grid.Column="0">
                     <Grid.ColumnDefinitions>
                             <ColumnDefinition Width="Auto"/>
                             <ColumnDefinition Width="*" />
                     </Grid.ColumnDefinitions>

                     <basics:GridSplitter HorizontalAlignment="Stretch" MouseEnter="TurnOnPoliceInfo"/>

                     <controls:TabControl Name="PoliceTabControl" Margin="5" HorizontalAlignment="Left" Grid.Column="1"  Visibility="Collapsed" MouseLeave="TurnOffPoliceInfo">
                                  <!-- SOME TAB CONTROL STUFF --> 
                      </controls:TabControl>

             </Grid>

             <Grid Grid.Column="1">

                     <!-- MY MAP VIEW -->

             </Grid>
</Grid>


    Private Sub TurnOnPoliceInfo(ByVal sender As Object, ByVal e As RoutedEventArgs)
        If Me.PoliceTabControl.Visibility = System.Windows.Visibility.Collapsed Then
            Me.PoliceTabControl.Visibility = System.Windows.Visibility.Visible
        Else
            Me.PoliceTabControl.Visibility = System.Windows.Visibility.Collapsed
        End If
    End Sub

    Private Sub TurnOffPoliceInfo(ByVal sender As Object, ByVal e As RoutedEventArgs)
        If Me.PoliceTabControl.Visibility = System.Windows.Visibility.Visible Then
            Me.PoliceTabControl.Visibility = System.Windows.Visibility.Collapsed
        Else
            Me.PoliceTabControl.Visibility = System.Windows.Visibility.Visible
        End If
    End Sub
0 Kudos