Reputation: 36244
I got a combobox in the grid's column:
<ListView>
<ListView.View>
<GridView>
<GridViewColumn>
<GridViewColumn.CellTemplate>
<DataTemplate>
<ComboBox />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
Now, in the SelectionChanged() of ComboBox I'm trying to change some value in an other column but the same row. And I can't find how to get the current row. none of the following doesn't work
ListView.Items.CurrentPosition ListView.Items.CurrentItem
please guys help me
Upvotes: 2
Views: 1892
Reputation: 2337
You should try to avoid accessing the controls directly. Bindings in WPF are pretty powerful and should cover all cases. However if you really want to navigate through the hierarchy of controls you could use VisualTreeHelper.
VisualTreeHelper
has lots of methods to transverse the tree of nested controls. In your case VisualTreeHelper.GetParent(comboBoxInstance)
is the one you are looking for.
Upvotes: 1