darkforces
New member
- Joined
- Jun 15, 2006
- Messages
- 1
- Programming Experience
- Beginner
Hi there I have the following datagrid
when I click the delete button I want the following procedure to fire
However it completely ignore this according to the debugger and fires
Im pulling my hair out over this one, so if anyone can help that would be great.
VB.NET:
<trans:groupedgrid id="DecisionGrid" runat="server" EnableViewState="False" AutoGenerateColumns="False"
AllowCustomSorting="True" CssClass="search-results-table percent80" AllowRowHighlighting="True"
RemoveRedundantBorders="False" ReorganiseItemStyles="True" UseAccessibleHeader="True">
<Columns>
<asp:BoundColumn DataField="decision_datetime" SortExpression="decision_datetime" HeaderText="Date of Hearing"></asp:BoundColumn>
<asp:BoundColumn DataField="applicant" SortExpression="applicant" HeaderText="Applicant"></asp:BoundColumn>
<asp:BoundColumn DataField="respondent" SortExpression="respondent" HeaderText="Respondent"></asp:BoundColumn>
<asp:BoundColumn DataField="title_no" SortExpression="title_no" HeaderText="Title No"></asp:BoundColumn>
<asp:BoundColumn DataField="category" SortExpression="category" HeaderText="Category"></asp:BoundColumn>
<asp:BoundColumn DataField="subcategory" SortExpression="subcategory" HeaderText="Subcategory"></asp:BoundColumn>
<asp:BoundColumn DataField="is_published" SortExpression="is_published" HeaderText="Published"></asp:BoundColumn>
<asp:ButtonColumn Text="Delete" CommandName="Delete">
<itemstyle HorizontalAlign="Center" />
</asp:ButtonColumn>
</Columns>
</trans:groupedgrid>
when I click the delete button I want the following procedure to fire
VB.NET:
Private Sub DecisionGrid_DeleteCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DecisionGrid.DeleteCommand
Dim DecIDLabel As Label = e.Item.FindControl("DecIDLabel")
If Not DecIDLabel Is Nothing Then
Me.DeleteDecision(DecIDLabel.Text)
End If
End Sub
However it completely ignore this according to the debugger and fires
VB.NET:
Private Sub DecisionGrid_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles DecisionGrid.ItemDataBound
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
e.Item.Attributes.Add("onclick", "RowOnClick('" & DataBinder.Eval(e.Item.DataItem, "judgmentid") & "');")
e.Item.Cells(0).Text = DateTime.Parse(DataBinder.Eval(e.Item.DataItem, "decision_datetime")).ToShortDateString
e.Item.Cells(1).Text += " " & DataBinder.Eval(e.Item.DataItem, "casenumber") & " " & DataBinder.Eval(e.Item.DataItem, "year")
If Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "is_published")) = 0 Then
e.Item.Cells(6).Text = "N"
e.Item.Cells(6).ForeColor = Color.Red
Else
e.Item.Cells(6).Text = "Y"
End If
End If
End Sub
Im pulling my hair out over this one, so if anyone can help that would be great.