Can I 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 on the object associated with this line. My timer code works fine, but I would also like to disable the buttons on any other line so that you can only work on one timer.
I used
WorkItemGrid.Columns[WorkItemGrid.Columns.Count - 1].GetCellContent(item).IsEnabled = false
to disable it, and all the buttons are displayed correctly, but if you double-click the button, it will be re-installed and will allow you to click on it a third time and trigger the Click event. Is it possible to actually disable the button?
source
share