Argghh my controls are disabled and cannot figure out why!!!
-
I have a Silverlight 3.0 application which has the following:
listbox listbox grid (editContainer)
Customers Locations 3 comboboxes
2 textboxes
2 buttonsAt 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 have a Silverlight 3.0 application which has the following:
listbox listbox grid (editContainer)
Customers Locations 3 comboboxes
2 textboxes
2 buttonsAt 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
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)
-
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)
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!!!
-
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!!!
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)