Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Argghh my controls are disabled and cannot figure out why!!!

Argghh my controls are disabled and cannot figure out why!!!

Scheduled Pinned Locked Moved WPF
databasehtmlcssdotnetwpf
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Michael Eber
    wrote on last edited by
    #1

    I have a Silverlight 3.0 application which has the following:

    listbox listbox grid (editContainer)
    Customers Locations 3 comboboxes
    2 textboxes
    2 buttons

    At startup the customer listbox is populated -- nothing else! At this point all of the controls in the editContainer are unaccessible...as if they are in a disabled state. :( When a customer is selected the customer Locations list is populated, 2 comboboxes are populated. I've walked through this in debug mode and confirmed that the comboboxes are indeed getting data. The combo boxes are using code from another site that inherits the base silverlight code and adds the population logic when a database item has the key value instead of the text value in the combo box. When I get the message that I can now edit data, everything in the editContainer is still in a disabled state. :( ComboBoxes don't drop down, cannot get my cursor entered into the textbox, and my buttons don't fire events. I initially thought it was because I added code to set the selected index on the combo boxes to -1, but even after commenting all that out I still have read-only controls. here is the xaml:

    <navigation:Page
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"

           xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input" 
           xmlns:DatabaseManager\_Silverlight\_MasterService="clr-namespace:DatabaseManager.Silverlight.MasterService" 
           xmlns:DatabaseManager\_Silverlight="clr-namespace:DatabaseManager.Silverlight" 
           xmlns:mycompany\_Silverlight\_Controls="clr-namespace:mycompany.Silverlight.Controls;assembly=mycompany.Silverlight.Controls" 
           x:Class="DatabaseManager.Silverlight.Views.ManageCustomerLocations"
           d:DesignWidth="800" d:DesignHeight="600"
           Title="ManageCustomerLocations Page">
    <Grid x:Name="LayoutRoot" Background="#FFF8F8DE">
    	<Grid x:Name="editContainer" Margin="8,20,8,6">
    
    		<ListBox x:Name="customerList" Horizontal
    
    I 1 Reply Last reply
    0
    • M Michael Eber

      I have a Silverlight 3.0 application which has the following:

      listbox listbox grid (editContainer)
      Customers Locations 3 comboboxes
      2 textboxes
      2 buttons

      At startup the customer listbox is populated -- nothing else! At this point all of the controls in the editContainer are unaccessible...as if they are in a disabled state. :( When a customer is selected the customer Locations list is populated, 2 comboboxes are populated. I've walked through this in debug mode and confirmed that the comboboxes are indeed getting data. The combo boxes are using code from another site that inherits the base silverlight code and adds the population logic when a database item has the key value instead of the text value in the combo box. When I get the message that I can now edit data, everything in the editContainer is still in a disabled state. :( ComboBoxes don't drop down, cannot get my cursor entered into the textbox, and my buttons don't fire events. I initially thought it was because I added code to set the selected index on the combo boxes to -1, but even after commenting all that out I still have read-only controls. here is the xaml:

      <navigation:Page
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      mc:Ignorable="d"
      xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"

             xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input" 
             xmlns:DatabaseManager\_Silverlight\_MasterService="clr-namespace:DatabaseManager.Silverlight.MasterService" 
             xmlns:DatabaseManager\_Silverlight="clr-namespace:DatabaseManager.Silverlight" 
             xmlns:mycompany\_Silverlight\_Controls="clr-namespace:mycompany.Silverlight.Controls;assembly=mycompany.Silverlight.Controls" 
             x:Class="DatabaseManager.Silverlight.Views.ManageCustomerLocations"
             d:DesignWidth="800" d:DesignHeight="600"
             Title="ManageCustomerLocations Page">
      <Grid x:Name="LayoutRoot" Background="#FFF8F8DE">
      	<Grid x:Name="editContainer" Margin="8,20,8,6">
      
      		<ListBox x:Name="customerList" Horizontal
      
      I Offline
      I Offline
      Ian Shlasko
      wrote on last edited by
      #2

      Michael Eber wrote:

      <Grid x:Name="locationContainer" Margin="291,16,0,29" IsHitTestVisible="False">

      There's your problem right there. IsHitTestVisible applies to the object and its children, and prevents it from responding to mouse events.

      Proud to have finally moved to the A-Ark. Which one are you in? Author of Guardians of Xen (Sci-Fi/Fantasy novel)

      M 1 Reply Last reply
      0
      • I Ian Shlasko

        Michael Eber wrote:

        <Grid x:Name="locationContainer" Margin="291,16,0,29" IsHitTestVisible="False">

        There's your problem right there. IsHitTestVisible applies to the object and its children, and prevents it from responding to mouse events.

        Proud to have finally moved to the A-Ark. Which one are you in? Author of Guardians of Xen (Sci-Fi/Fantasy novel)

        M Offline
        M Offline
        Michael Eber
        wrote on last edited by
        #3

        OMG! Thank you so much. I've been on app so long I'm seeing the forest and missing the trees. :laugh: You saved several more hours of hunting for this!!!

        I 1 Reply Last reply
        0
        • M Michael Eber

          OMG! Thank you so much. I've been on app so long I'm seeing the forest and missing the trees. :laugh: You saved several more hours of hunting for this!!!

          I Offline
          I Offline
          Ian Shlasko
          wrote on last edited by
          #4

          No problem :) You stare at your own code for too long, you start to focus on some parts and disregard others... Then all it takes is a fresh pair of eyes to find the piece you ignored. When I think I'm getting to this point, I usually hop on CP or /. for a bit to reboot the old brain.

          Proud to have finally moved to the A-Ark. Which one are you in? Author of Guardians of Xen (Sci-Fi/Fantasy novel)

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups