Hello,

I want to add TemplateColumn to DataGrid dynamicaly.
How to add, to this column checkbox (not bounded) and attach event, which argument has row values.


With ButtonColumn it's simple:

VB Code:
  1. Dim CallBtn As New ButtonColumn
  2. CallBtn.CommandName = "Deal"
  3. CallBtn.ButtonType = ButtonColumnType.LinkButton
  4. AddHandler RegDG.ItemCommand, AddressOf  RegDG_ItemCommand
  5.  
  6. Private Sub RegDG_ItemCommand(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)
  7.             If e.CommandName = "Deal" Then
  8.                 CallSub(CType(e.CommandSource, LinkButton).Text)
  9.             End If
  10.         End Sub

but what to do if I need checkbox, not button or linkbutton?