大家好,请问下如何获取到treeListView,代码如下,无法通过Name="treeListView"获取到,请问下cs文件中如何获取到Name="treeListView"这个控件呢,谢谢
1 <Grid> 2 <dxg:LookUpEdit x:Name="editor" AutoPopulateColumns="False" DisplayMember="Name" ValueMember="ID" HorizontalAlignment="Center" VerticalAlignment="Center" Width="350" IsTextEditable="False"> 3 <dxg:LookUpEdit.PopupContentTemplate> 4 <ControlTemplate> 5 <dxg:GridControl x:Name="PART_GridControl"> 6 <dxg:GridControl.Columns> 7 <dxg:GridColumn FieldName="Name" /> 8 <dxg:GridColumn FieldName="Position" /> 9 <dxg:GridColumn FieldName="Department" /> 10 </dxg:GridControl.Columns> 11 <dxg:GridControl.View> 12 <dxg:TreeListView Name="treeListView" ShowAutoFilterRow="False" AutoWidth="True" ShowCheckboxes="True" AllowPerPixelScrolling="True" 13 KeyFieldName="ID" ParentFieldName="ParentID" SelectionChanged="TreeListView_SelectionChanged" NodeCheckStateChanged="TreeListView_NodeCheckStateChanged"/> 14 </dxg:GridControl.View> 15 </dxg:GridControl> 16 </ControlTemplate> 17 </dxg:LookUpEdit.PopupContentTemplate> 18 <dxg:LookUpEdit.StyleSettings> 19 <dxg:MultiSelectLookUpEditStyleSettings /> 20 </dxg:LookUpEdit.StyleSettings> 21 </dxg:LookUpEdit> 22 </Grid>
this.editor.Template.FindName("treeListView",this.ediotr) as TreeListView