I am trying to execute an action SelectedItem
on row selected with DataGrid
.
I have a lot of code so I just put here the relevant parts.
If you need more information please tell me.
When I click the row it's selected and the action is executed.
It opens another window and lets the user do something there.
I also want to let one chose this row again and Action
this Set
method again, but it's doing nothing until I chose another row and only after I chose another row it lets me get the first row.
In short, I want to be able to execute an action on selecting row1
and then execute it again on selecting row1
again.
My XAML code:
<DataGrid IsReadOnly="True" Name="DataGridProject" ItemsSource="{Binding ProjectList}"
AutoGenerateColumns="False" FontSize="22"
SelectedItem="{Binding SelectedRowItem,Mode=TwoWay}" DockPanel.Dock="Bottom" MaxHeight="300"
MinHeight="350" Height="350" SelectionMode="Single"/>
My ModelView Code:
public class PreTestInformationProjectAccessVM : INotifyPropertyChanged
{
public DataRowView SelectedRowItem
{
get
{
return _SelectedRowItem;
}
set
{
_SelectedRowItem = value;
// ...
}
}
}