Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2732
DataGrid: Button in Column
posted

Hello,

Is it possible to put a button in a cell?

<DataGrid DataSource="@exceptions" AutoGenerateColumns="false" Height="100%" Width="100%">
      <TextColumn Field="ApplicationName" />
      <TextColumn Field="Id" />
      <TextColumn Field="ApplicationUser" />
      <TextColumn Field="MachineName" HeaderText="Server" />
      <TextColumn Field="ExceptionMessage" />
      <TextColumn Field="EnvironmentName" />
      <TextColumn Field="Severity" />
      <TemplateColumn> <button @onclick="@(() => OpenException(Id))">Detail</button></TemplateColumn>
  </DataGrid>
This does not seem to work. Also how do I access a property (Id)?