I am creating the column structure programmatically as followers:
Dim dt as New DataTable
Dim clm_AddUser As New GridButtonColumn
Dim clm_DenyUser As New GridButtonColumn
dt.Columns.Add("clm_AddUser")
dt.Columns.Add("clm_DenyUser")
clm_AddUser.DataTextField = "clm_AddUser"
clm_DenyUser.DataTextField = "clm_DenyUser"
clm_AddUser.ButtonType = GridButtonColumnType.ImageButton
clm_DenyUser.ButtonType = GridButtonColumnType.ImageButton
clm_AddUser.ImageUrl = "~/images/AddUser.gif"
clm_AddUser.CommandName = "AddUser"
clm_AddUser.CommandArgument = "AddUser"
clm_DenyUser.ImageUrl = "~/images/DenyUser.gif"
clm_DenyUser.CommandName = "DenyUser"
clm_DenyUser.CommandArgument = "DenyUser"
dt.Rows.Add("AddColumn", "DenyColumn")
now, in my ItemCommand section, I have:
Private Sub grd_PendingLinks_ItemCommand(sender As Object, e As Telerik.Web.UI.GridCommandEventArgs) Handles grd_PendingLinks.ItemCommand
If e.CommandName = "AddUser" Then lbl_pendinglinkreqs.Text = "ADD USER!"
If e.CommandName = "DenyUser" Then lbl_pendinglinkreqs.Text = "DENY USER!"
End Sub
this WILL get triggered if I turn off the ButtonType to Image, and leave it as default.
However, as soon as ButtonType is set to Image, the ItemCommand does NOT get triggered.
I have read of ways that I can do 'OnClick', but that requires setting a template in the .aspx file itself, and I am unsure of how to do that. So I am doing it programmatically.
Is this by design? Am I doing something wrong? Any info would be great.
Dim dt as New DataTable
Dim clm_AddUser As New GridButtonColumn
Dim clm_DenyUser As New GridButtonColumn
dt.Columns.Add("clm_AddUser")
dt.Columns.Add("clm_DenyUser")
clm_AddUser.DataTextField = "clm_AddUser"
clm_DenyUser.DataTextField = "clm_DenyUser"
clm_AddUser.ButtonType = GridButtonColumnType.ImageButton
clm_DenyUser.ButtonType = GridButtonColumnType.ImageButton
clm_AddUser.ImageUrl = "~/images/AddUser.gif"
clm_AddUser.CommandName = "AddUser"
clm_AddUser.CommandArgument = "AddUser"
clm_DenyUser.ImageUrl = "~/images/DenyUser.gif"
clm_DenyUser.CommandName = "DenyUser"
clm_DenyUser.CommandArgument = "DenyUser"
dt.Rows.Add("AddColumn", "DenyColumn")
now, in my ItemCommand section, I have:
Private Sub grd_PendingLinks_ItemCommand(sender As Object, e As Telerik.Web.UI.GridCommandEventArgs) Handles grd_PendingLinks.ItemCommand
If e.CommandName = "AddUser" Then lbl_pendinglinkreqs.Text = "ADD USER!"
If e.CommandName = "DenyUser" Then lbl_pendinglinkreqs.Text = "DENY USER!"
End Sub
this WILL get triggered if I turn off the ButtonType to Image, and leave it as default.
However, as soon as ButtonType is set to Image, the ItemCommand does NOT get triggered.
I have read of ways that I can do 'OnClick', but that requires setting a template in the .aspx file itself, and I am unsure of how to do that. So I am doing it programmatically.
Is this by design? Am I doing something wrong? Any info would be great.