We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
I use the DataGrid with some DataGridTextColumns and a DataGridTemplatedColumn that must contain a button allowing to navigate to another page.
In code-behind, there is no problem. But when I try to use a ViewModel implementation with a Command, it doesn't work!
The code looks like this:
<controls:DataGrid x:Name="DataGrid" Grid.Row="1" ItemsSource="{Binding MyForms}" SelectionMode="Single" SelectedItem="{Binding SelectedForm, Mode=TwoWay}" DefaultOrderIndex="1"> <controls:DataGrid.Columns> <controls:DataGridTextColumn Width="0.7*" Header="Form Nr" Binding="{Binding form_id}" /> <controls:DataGridTextColumn Width="*" Header="Submitter" Binding="{Binding submitter}" /> ... <controls:DataGridTemplatedColumn Width="*" Header="Action"> <controls:DataGridTemplatedColumn.CellTemplate> <DataTemplate> <Button Content="Open"> <i:Interaction.Behaviors> <core:EventTriggerBehavior EventName="Tapped"> <core:InvokeCommandAction Command="{Binding OpenFormCommand}" /> </core:EventTriggerBehavior> </i:Interaction.Behaviors> </Button> </DataTemplate> </controls:DataGridTemplatedColumn.CellTemplate> </controls:DataGridTemplatedColumn> </controls:DataGrid.Columns> ... </controls:DataGrid>
Would you have an idea?
The text was updated successfully, but these errors were encountered:
Do you have binging errors in your output? The context inside a column is the item not the root view model... You could bind to the parent view model via a static resource, see https://blog.rsuter.com/recommendations-best-practices-implementing-mvvm-xaml-net-applications/
Sorry, something went wrong.
No branches or pull requests
Hello,
I use the DataGrid with some DataGridTextColumns and a DataGridTemplatedColumn that must contain a button allowing to navigate to another page.
In code-behind, there is no problem.
But when I try to use a ViewModel implementation with a Command, it doesn't work!
The code looks like this:
Would you have an idea?
The text was updated successfully, but these errors were encountered: