I am new to WinUI and using CommunityToolkit.WinUI.UI.Controls
for my WinUI3 application. Where I am using Datagrid. One of the columns is generating like follows:
<controls:DataGridTextColumn Binding="{Binding MessageId}" Header="Id" />
I also have a Button column generated for the action in the grid as follows:
<controls:DataGridTemplateColumn Header="Action">
<controls:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Click="SendAsync" CommandParameter="{Binding Path=MessageId}">Send</Button>
</DataTemplate>
</controls:DataGridTemplateColumn.CellTemplate>
</controls:DataGridTemplateColumn>
</controls:DataGrid.Columns>
My problem is that this button should only be visible based on the column "Status" from the Source. After searching on the internet I could not find any solution. I used to use row_update
on the WinForm application where we can use conditional visibility based on any cell value.
Please suggest to me how to overcome this kind of problem for conditional visibility/ Row_update
like functionality in WinUI3.