Based on the data type I am pouplating grid's column with different controls.All the controls are binded to property on Model
On the Cell Click I am setting SelectedProperty on Model.
The problem is when row with DatePicker is selected and I go and click numericupdown, 1st numericupdown control event is fired and then Grid's Cell Click event is fired . Same is true for DatePicker.
Is there any way to fire 1st Grid's Cell Click or any other event and than NumericUpDown/DatePicker event.
private TemplateColumn _TempCol = new TemplateColumn(); switch (property.SQLDataType.ToLower()) { case "date": { _TempCol.ItemTemplate = Resources["ColDatePicker"] as DataTemplate; break; } case "varchar": { _TempCol.ItemTemplate = Resources["ColText"] as DataTemplate; break; } case "float": { _TempCol.ItemTemplate = Resources["ColFloatNumericUpdown"] as DataTemplate; break; } case "int": { _TempCol.ItemTemplate = Resources["ColIntNumericUpdown"] as DataTemplate; break; } case "char": { _TempCol.ItemTemplate = Resources["ColText"] as DataTemplate; break; } case "bit": { _TempCol.ItemTemplate = Resources["Colcombobox"] as DataTemplate; break; } }
Hi,
The events bubble up in SL, which means that children get first dibs on events.
What exactly are you trying to do? Maybe there is a better approach to achieve what you're trying to do.
-SteveZ
I am adding cotrol to grid row dynamically a below.
I have a tab control and the below code is a part of on tab when I am switching tab and coming back to my tab all controls are messed up. Initially I have some date, text and combo box controls.
but after swtiching back all the controls are changing to same type...
Do you happen to have a sample that demonstrates the issue you're seeing?
I will upload the project asap..I have one quetsion regarding XAMTree...I want to add a Spinner control to xamtreeitem and than make it visible only for the selected tree node..
I have added this in style of xamtreeitem
<
Controls1:EPMWaitControl x:Name="WaitAnimation" IsEnabled="true" Grid.Row="0" Grid.Column ="4" Canvas.ZIndex="999" DataContext="{Binding}" VerticalAlignment="Top" AnimationBackColor ="Red" />
in
<Grid x:Name="MouseHitArea" Background="Transparent" Grid.Row ="0"><Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius ="2"/>
<Border x:Name="MouseOver1" BorderBrush="{StaticResource ItemHottrackOuterBorderFill}" BorderThickness="{TemplateBinding BorderThickness}" Background="{StaticResource ItemHottrackCenterFill}" CornerRadius="2" Opacity ="0"/>
<Border x:Name="Selected1" BorderBrush="{StaticResource ItemSelectedOuterBorderFill}" BorderThickness="{TemplateBinding BorderThickness}" Background="{StaticResource ItemSelectedCenterFill}" CornerRadius="2" Visibility ="Collapsed"/>
<Rectangle x:Name="FocusRectangle" Fill="Transparent" IsHitTestVisible="False" StrokeDashOffset="10" StrokeDashCap="Round" Stroke="Black" StrokeThickness="1" StrokeDashArray="1 5" Visibility ="Collapsed"/>
<igPrim:ExpansionIndicator x:Name="ExpansionIndicator" IndicatorVisibility="Collapsed" IsExpanded="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Margin="{Binding Level, ConverterParameter=15, Converter={StaticResource LeftMarginConverter}, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent }}">
<Border>
<Grid Background ="Transparent">
<Grid HorizontalAlignment ="Left">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5"/>
<ColumnDefinition />
<ColumnDefinition Width ="Auto"/>
</Grid.ColumnDefinitions>
<ContentControl x:Name="ExpandedIcon" Grid.Column="1" HorizontalContentAlignment="Stretch" Opacity="1" VerticalContentAlignment="Stretch"/>
<ContentControl x:Name="CollapsedIcon" Grid.Column="1" HorizontalContentAlignment="Stretch" Opacity="0" VerticalContentAlignment="Stretch"/><CheckBox x:Name="CheckBox" Grid.Column="2" VerticalAlignment="{TemplateBinding VerticalAlignment }"/>
<ContentPresenter x:Name="Header" Content="{TemplateBinding Header}" Grid.Column="3" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalAlignment }"/>
<Controls1:EPMWaitControl x:Name="WaitAnimation" IsEnabled="true" Grid.Row="0" Grid.Column ="4" Canvas.ZIndex="999" DataContext="{Binding}" VerticalAlignment="Top" AnimationBackColor ="Red" />
</Grid>
I am trying to access the WaitAnimation control which I added to the style.So that I can make it visible/hide for a selected tree node. But I am not able to access this control as a xamtreeitem.??
I will appreciate quick reponse
Thanks
This is a XamTree question so it should be posted in this forum, and not appended to a xamGrid question.
However, you should be using VisualStateManager and toggle it's Visibilty in the Selected state of the ControlTemplate of the XamTreeItem.