Wondering if there's any trick to accessing a nested control in the code-behind ?
given some XAML along the lines of
<UserControl>
<textbox />
<DataGrid Name="MyGrid">
<Columns>
<Column field=ABC>
<EditType>
<ComboBox Name="myCombo1"/>
I can access this.MyGrid but cannot access this.myCombo1 !!
In simple cases you can access elements using their name, but looks like combobox is datatemplate part, you can work with visual tree at runtime using VisualTreeHelper , but if you use mvvm & code right usually you don't need to access elements directly. Can you provide more information on general problem or test project to reproduce issue?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.