诗人、学者、民主战士

吴海晶

博客园 首页 联系 订阅 管理

 研究了一下DevExpress的SearchControl,供大家参考使用:

<dxe:SelectorEditColumnProvider x:Name="columnProvider" OwnerEdit="{Binding Path=., ElementName=treeList}"/>

                <dxe:SearchControl x:Name="searchControl" Margin="6 0 5 0" MinHeight="22" MinWidth="200" VerticalAlignment="Center"

                                   ColumnProvider="{Binding Path=., ElementName=columnProvider}" FilterByColumnsMode="Custom" SearchTextPostDelay="100"/>

 

 

<dxg:TreeListControl x:Name="treeList" Grid.Row="2" ItemsSource="{Binding Ships}" ShowBorder="False"

                               SelectionMode="{Binding SelectionMode}" FilterCriteria="{Binding FilterCriteria, ElementName=searchControl}">

                <dxg:TreeListControl.Columns>

                    <dxg:TreeListColumn FieldName="CameraID" VisibleIndex="0" Header="编码"/>

                    <dxg:TreeListColumn FieldName="Name" VisibleIndex="1" Header="名称"/>

                    <!--<dxg:TreeListColumn FieldName="FullName" UnboundType="String"

                                    UnboundExpression="[FirstName] + ' ' + [LastName]" VisibleIndex="1" ReadOnly="True" />

                    <dxg:TreeListColumn FieldName="City" VisibleIndex="2" />

                    <dxg:TreeListColumn FieldName="AddressLine1" Header="Address" VisibleIndex="3" />

                    <dxg:TreeListColumn FieldName="Phone" VisibleIndex="4" />-->

                </dxg:TreeListControl.Columns>

                <dxg:TreeListControl.TotalSummary>

                    <dxg:TreeListSummaryItem FieldName="CameraID" SummaryType="Count"/>

                </dxg:TreeListControl.TotalSummary>

                <dxg:TreeListControl.View>

 

                    <dxg:TreeListView x:Name="view"

                                  ParentFieldName="ParentID" KeyFieldName="NodeID"

                                  EditorShowMode="MouseUpFocused" AutoExpandAllNodes="True" NodeImageSelector="{StaticResource categoryImageSelector}"

                                  AutoWidth="True" ShowTotalSummary="True" ShowFilterPanelMode="Never" ShowNodeImages="True" ShowColumnHeaders="False" ShowIndicator="False" ShowHorizontalLines="False" ShowVerticalLines="False">

                

                    </dxg:TreeListView>

                </dxg:TreeListControl.View>

                <i:Interaction.Behaviors>

                    <dxg:TreeListDragDropManager x:Name="dragDropManager" AllowDrag="True" DragOver="dragDropManager_DragOver_1" DragElementTemplate="{StaticResource dragelementTemplate}">

                       

                    </dxg:TreeListDragDropManager>

                </i:Interaction.Behaviors>

            </dxg:TreeListControl>

 

this.columnProvider.CustomColumns = new ObservableCollection<string>() {"Name"};

posted on 2014-08-03 01:44  吴海晶  阅读(1274)  评论(0)    收藏  举报