Is it possible to disable a button in a DataGridTemplateColumn? I have a DataGridTemplate as follows:
<toolkit:DataGridTemplateColumn Header="Timer" Width="50">
<toolkit:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Content="Start" Click="Button_Click" CommandParameter="{Binding}" />
</DataTemplate>
</toolkit:DataGridTemplateColumn.CellTemplate>
</toolkit:DataGridTemplateColumn>
The purpose of the Button is to start a timer recorded to the object associated with that row. My timer code works fine but I would also like to disable the buttons of every other row so that you can only have one timer running.
I used
WorkItemGrid.Columns[WorkItemGrid.Columns.Count - 1].GetCellContent(item).IsEnabled = false
to disable it and all the buttons correctly appear disabled but if you click on the button twice it will reenable and allow you to click on it a third time and trigger the Click event. Is it possible to actually disable the button?