P
PD
I am generating a dynamic datagrid that gets assigned to a cell within
the parent grid. Here's the html:
<aspataGrid id="dgPositions" runat="server" Width="710"
CellPadding="3" HeaderStyle-Font-Bold="True" CssClass="inputfields"
AutoGenerateColumns="False">
<Columns>
<asp:TemplateColumn></asp:TemplateColumn>
</Columns>
</aspataGrid>
I have a custom control within the child grid that inherits from the
ImageButton control:
With cb
.ToolTip = "Remove"
.CausesValidation = False
.ImageUrl = "images/delete_s1.gif"
.Message = "Are you sure you want to delete
this?"
.ID = "btnRemove"
.AlternateText = "Remove"
.CommandName = "Delete"
End With
container.Controls.Add(cb)
The child grid is constructed within the dgPositions_ItemDataBound
function of the parent grid.
dgNewGrid.HeaderStyle.Font.Bold = True
dgNewGrid.CellPadding = 3
dgNewGrid.CssClass = "inputfields"
dgNewGrid.AutoGenerateColumns = False
dgNewGrid.ID = "gridPositions"
AddHandler dgNewGrid.ItemCommand, AddressOf
dgPositions_ItemCommand2
dgi.Cells(0).Controls.Add(dgNewGrid)
I want the dgPositions_ItemCommand2 to kick off when the user clicks
on the custom control (cb) above. The code to
dgPositions_ItemCommand2:
Public Sub dgPositions_ItemCommand2(ByVal sender As Object, ByVal
e As System.Web.UI.WebControls.DataGridCommandEventArgs)
Try
If e.CommandName = "Delete" Then
Response.Write("Test")
End If
Catch ex As Exception
Response.Write(ex.Message)
End Try
End Sub
I have not been successful in getting the dgPositions_ItemCommand2
code to kick off. Any thoughts/suggestions would be greatly
appreciated!!
Thanks,
Patrick
the parent grid. Here's the html:
<aspataGrid id="dgPositions" runat="server" Width="710"
CellPadding="3" HeaderStyle-Font-Bold="True" CssClass="inputfields"
AutoGenerateColumns="False">
<Columns>
<asp:TemplateColumn></asp:TemplateColumn>
</Columns>
</aspataGrid>
I have a custom control within the child grid that inherits from the
ImageButton control:
With cb
.ToolTip = "Remove"
.CausesValidation = False
.ImageUrl = "images/delete_s1.gif"
.Message = "Are you sure you want to delete
this?"
.ID = "btnRemove"
.AlternateText = "Remove"
.CommandName = "Delete"
End With
container.Controls.Add(cb)
The child grid is constructed within the dgPositions_ItemDataBound
function of the parent grid.
dgNewGrid.HeaderStyle.Font.Bold = True
dgNewGrid.CellPadding = 3
dgNewGrid.CssClass = "inputfields"
dgNewGrid.AutoGenerateColumns = False
dgNewGrid.ID = "gridPositions"
AddHandler dgNewGrid.ItemCommand, AddressOf
dgPositions_ItemCommand2
dgi.Cells(0).Controls.Add(dgNewGrid)
I want the dgPositions_ItemCommand2 to kick off when the user clicks
on the custom control (cb) above. The code to
dgPositions_ItemCommand2:
Public Sub dgPositions_ItemCommand2(ByVal sender As Object, ByVal
e As System.Web.UI.WebControls.DataGridCommandEventArgs)
Try
If e.CommandName = "Delete" Then
Response.Write("Test")
End If
Catch ex As Exception
Response.Write(ex.Message)
End Try
End Sub
I have not been successful in getting the dgPositions_ItemCommand2
code to kick off. Any thoughts/suggestions would be greatly
appreciated!!
Thanks,
Patrick