我正在UWP的Telerik RadDataGrid控件内使用一个网格,我已将刷卡行为附加到该网格上。它已连接,但未触发ManipulationCompleted事件。
delete ac
from s_articles_categories ac join
(select articleId, categoryid, min(id) as min_id
from s_articles_categories
where categoryID = 2153
group by articleId, categoryid
) ac2
on ac2.articleId = ac.articleId and
ac2.categoryid = ac.categoryid and
ac.id > ac2.min_id
在LeftSwipe行为中,我在OnAttached方法中编写了以下代码
<telerikGrid:RadDataGrid x:Name="MyDataGrid">
<telerikGrid:RadDataGrid.Columns>
<telerikGrid:DataGridTemplateColumn x:Name="DescriptionColumn"
SizeMode="Stretch"
CanUserSort="True"
SortDirection="{Binding DataContext.SortingDirection,ElementName=gdRoot, Mode=TwoWay}"
CanUserReorder="False">
<telerikGrid:DataGridTemplateColumn.Header>
<Grid HorizontalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="250" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Text="Description" HorizontalAlignment="Stretch" />
<ToggleSwitch Grid.Column="1"
x:Name="nestedView"
VerticalAlignment="Top"
IsOn="{Binding DataContext.IsNestedView, ElementName=gdRoot, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchStyle}"
HorizontalAlignment="Left" />
</Grid>
</telerikGrid:DataGridTemplateColumn.Header>
<telerikGrid:DataGridTemplateColumn.CellContentTemplate>
<DataTemplate>
<Grid HorizontalAlignment="Stretch"
x:Name="ParentItemCode">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Border Background="Transparent" BorderThickness="0"
Visibility="{Binding ParentItemCode, Converter={StaticResource NullToVisibilityConverter}}">
<Image Source="ms-appx:///Assets/Arrow-Small.png" Loaded="ControlLoaded"
Visibility="{Binding IsNestedView, Converter={StaticResource BoolToVisibilityConverter}}" />
</Border>
<TextBlock Text="{Binding Description}"
Opacity="{Binding IsItemEnable, Converter={StaticResource BoolToDisableRowConverter}}"
IsHitTestVisible="{Binding IsItemEnable}"
Grid.Column="1"
Style="{StaticResource ColumnValues}" />
**
<Interactivity:Interaction.Behaviors>
<behavior:LeftSwipeBehavior ShowLeftSwipeTemplate="{Binding AvailableVM.IsPickListOptionsVisible, Mode=TwoWay}" />
</Interactivity:Interaction.Behaviors>
**
</Grid>
</DataTemplate>
</telerikGrid:DataGridTemplateColumn.CellContentTemplate>
</telerikGrid:DataGridTemplateColumn>
</telerikGrid:RadDataGrid.Columns>
</telerikGrid:RadDataGrid>