Select to view content in your preferred language

ComboBox error

764
4
03-10-2011 08:23 AM
JayKappy
Frequent Contributor
In my app I have a grid splitter that hides out on the left.  When the user hovers over it it expands to show the user a TOC with a bunch of tabs.
This works fine....
I then creates a few stack panels on the first tab and am running into an issue here...

The below has a radio button that when clicked expands further options.  This works fine.
In the part that expands there is Textbox, Textblock, and a Combobox.
Everything seems to be alright untill I click on the Combobox...When I do it closes the stackpanel that was created with the grid splitter....
I can click in textblox fine and type in data...but the ComboBox is closing everythign up...

Any thoughts?

 
<!-- SNIP -->
<StackPanel x:Name="SearchRadion1" Height="Auto" Width="185" Orientation="Vertical" Margin="5,0,0,5" HorizontalAlignment="Left" >
     <Grid x:Name="SearchRadioGrid1" HorizontalAlignment="left" VerticalAlignment="Top" Margin="0,2,0,0" MouseEnter="TurnOnStreets">
         <RadioButton x:Name="Search_3a" IsChecked="False" VerticalAlignment="Center" Checked="OpenRadioButtonSearchWindow" Margin="5,0,0,10" Foreground="White" GroupName="Layers2" Content="Search by Address" Tag="1"/>
     </Grid>
     <StackPanel Name="SearchRadioPanel1" Orientation="Vertical" Visibility="Collapsed" Height="Auto" Width="185" Margin="10,5,0,0">
         <StackPanel Orientation="Vertical" >
             <StackPanel Orientation="Vertical" >
                 <TextBox x:Name="FindAddressSearch" Background="White" Margin="15,0,0,0" Text="12800 Arbor Lake Blvd" Height="20" VerticalAlignment="Center" Width="250" HorizontalContentAlignment="Left" />
                 <TextBlock Name="AddressSearch1" Width="250" Height="4" Margin="15,0,0,0" Text="" HorizontalAlignment="Center" Foreground="Black" />
                 <TextBlock Name="AddressSearch2" Width="250" Height="20" Margin="15,0,0,0" Text="ex. 12800 Arbor Lakes Blvd" HorizontalAlignment="Left" Foreground="Black" />
             </StackPanel>
             <StackPanel Orientation="Vertical">
                 <ComboBox x:Name="DropDownDistance" Width="120" Margin="15,0,0,0" Height="20" SelectionChanged="DropDownDistanceSelection" SelectedIndex="0">
                     <ComboBoxItem Content="1/4 Mile(s)" />
                     <ComboBoxItem Content="1/2 Mile(s)" />
                     <ComboBoxItem Content="3/4 Mile(s)" />
                     <ComboBoxItem Content=" 1  Mile(s)" />
                     <ComboBoxItem Content=" 5  Mile(s)" />
                 </ComboBox>
             </StackPanel>
         </StackPanel>
     </StackPanel>
 </StackPanel>
<!-- SNIP -->
0 Kudos
4 Replies
JayKappy
Frequent Contributor
Why would the stack panel / grid collapse when I click the combobox?????
0 Kudos
JayKappy
Frequent Contributor
Anyone have any ideas?
0 Kudos
JenniferNery
Esri Regular Contributor
Sorry. It's hard to tell what would cause your grid to collapse. Place a breakpoint on your event handlers and see what the flow is, maybe you set the height/width to 0 somewhere or change the visibility in code.
0 Kudos
JayKappy
Frequent Contributor
I appreciate your thoughts....with them I have been able to narrow this down....but am stuck...

I have a TOC that when you hovers over it it expands to show the user the whole TOC.  When the user moves off the TOC "MouseLeave" then the TOC collapses...That works great...

But what I think is happening is that when I click on the Combobox that is in the TOC it sees this as leaving??????????
I remove the "MouseLeave" on the tab control in the TOC and it does not collapse....

Is there another way I can collapse the TOC
Is there a way that I can test to see if it was a combobox click and not collapse, else collapse?

Right now I removed the MouseLeave collapse and put a button in the Tab that closes the TOC

Thanks
0 Kudos