选择多个列表框项 [英] Selecting Multiple ListBox items

查看:81
本文介绍了选择多个列表框项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在使用其中显示文档图像的ExtendedListBox.我提供了以下代码.

< local:ExtendedListBox x:Name ="lstSourceDocumentThumbs" Style ="{StaticResource draggableListBox}" Background ="White"
ItemsSource ="{绑定路径= PageThumbsList,模式= TwoWay}"
ScrollViewer.Horizo​​ntalScrollBarVisibility ="Disabled" ClickOnSelectedItemAction ="KeepSelectionIfItemSelected" MouseLeftButtonUp ="MouseButtonUp"
ScrollViewer.VerticalScrollBarVisibility =自动" SelectionMode =扩展"
Horizo​​ntalAlignment ="Stretch" VerticalAlignment ="Stretch" Margin ="0"
ItemTemplate ="{StaticResource tplDistributePageThumb}">
< ListBox.ItemsPanel>
< ItemsPanelTemplate>
< telerik:RadWrapPanel>
</telerik:RadWrapPanel>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</local:ExtendedListBox>


当我选择多个文档,然后单击其中一个文档时,该文档将被取消选择,而另一个文档仍保持选中状态.但是我希望我单击的文档应该被选中,而其他文档则被取消选中.我可以使用
实现 ClickOnSelectedItemAction ="OverrideSelection"
但是,当我进行拖放操作时,仅拖放我在选择时选择的文档的问题就被拖动了.我希望如果我选择多个文档并进行拖动,那么所有这些文档都将被拖动,当我选择多个文档并单击任何文档时,仅该文档保持选中状态.

请帮助我如何实现?

谢谢,
Umesh Tayade

Hi All,

I am using the ExtendedListBox in which i am showing the document images. I have provided the code below.

<local:ExtendedListBox x:Name="lstSourceDocumentThumbs" Style="{StaticResource draggableListBox}" Background="White"
ItemsSource="{Binding Path=PageThumbsList, Mode=TwoWay}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled" ClickOnSelectedItemAction="KeepSelectionIfItemSelected" MouseLeftButtonUp="MouseButtonUp"
ScrollViewer.VerticalScrollBarVisibility="Auto" SelectionMode="Extended"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0"
ItemTemplate="{StaticResource tplDistributePageThumb}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<telerik:RadWrapPanel>
</telerik:RadWrapPanel>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</local:ExtendedListBox>


When I select multiple document and then click on any one of them then that document get deselected while the other remain selected. But i want that the document which i click should get selected while other get deselected. I can achieve this by using
ClickOnSelectedItemAction="OverrideSelection"
But the problem with this when i go for drag and drop only the document on which i selcted while dragging gets dragged. I want that if i select multiple document and goes for dragging then all these document gets dragged and when i select multiple document and just click any of the document only that document remain selectd.

Please help me how can i acheive this?

Thanks,
Umesh Tayade

推荐答案

这看起来像是您的问题:

This looks like your problem:

ClickOnSelectedItemAction="KeepSelectionIfItemSelected"


这篇关于选择多个列表框项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆