Dynamicaly created TemplateColumn with CheckBox
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:
Dim CallBtn As New ButtonColumn
CallBtn.CommandName = "Deal"
CallBtn.ButtonType = ButtonColumnType.LinkButton
AddHandler RegDG.ItemCommand, AddressOf RegDG_ItemCommand
Private Sub RegDG_ItemCommand(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)
If e.CommandName = "Deal" Then
CallSub(CType(e.CommandSource, LinkButton).Text)
End If
End Sub
but what to do if I need checkbox, not button or linkbutton?