有一个扩展的DevExpress令牌LookupEdit,其类继承了“ LookUpEdit”。代码后面是:
public partial class BaseItemSelector : UserControl
{
public BaseItemSelector()
{
InitializeComponent();
}
}
public class LookUpEditEx1 : LookUpEdit
{
protected override VisualClientOwner CreateVisualClient() { return new GridControlVisualClientOwnerEx1(this); }
}
public class GridControlVisualClientOwnerEx1 : GridControlVisualClientOwner
{
public GridControlVisualClientOwnerEx1(PopupBaseEdit editor) : base(editor) { }
protected override void InitializeSearchPanel() { }
}
以及在XAML中:
<local:LookUpEditEx1
IsTextEditable="True"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Width="432"
Height="49"
IncrementalFiltering="False"
ValueMember="CenterCode"
ItemsSource="{Binding Data, Source={StaticResource EntitySimpleDataSource}}"
DisplayMember="NameCenter"
x:Name="Token"
AutoComplete="True"
PopupHeight="400"
PopupWidth="400"
ValidateOnTextInput="False"
ValidateOnEnterKeyPressed="True"
IsPopupAutoWidth="True"
ImmediatePopup="True"
FilterCondition="Contains"
FindMode="FindClick"
CharacterCasing="Normal">
<dxg:LookUpEdit.PopupContentTemplate>
<ControlTemplate>
<dxg:GridControl x:Name="PART_GridControl">
<dxg:GridControl.View>
<dxg:TableView ShowCheckBoxSelectorColumn="True"
ShowGroupPanel="False"
ShowSearchPanelMode="Never"
SearchString="{Binding Path=(dxe:BaseEdit.OwnerEdit).AutoSearchText, RelativeSource={RelativeSource Self}}"/>
</dxg:GridControl.View>
</dxg:GridControl>
</ControlTemplate>
</dxg:LookUpEdit.PopupContentTemplate>
<dxg:LookUpEdit.StyleSettings>
<dxg:TokenLookUpEditStyleSettings SelectionMode="Multiple" NewTokenPosition="Far" AllowEditTokens="False" ShowTokenButtons="True"/>
</dxg:LookUpEdit.StyleSettings>
</local:LookUpEditEx1>
我将IncrementalFiltering设置为false,但是当我尝试搜索网格的数据时,它将仅显示搜索结果。如何更改这些代码以显示所有行并仅关注搜索结果?
此自定义标记LookupEdit显示一个复选框列,用于选择gridview的多行。