1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
Private Sub gvBons_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvBons.RowDataBound
Dim lkbgv As LinkButton
Dim row As GridViewRow = e.Row
Dim lblvg As Label
If e.Row.RowType = DataControlRowType.DataRow Then
Dim hf As HiddenField = e.Row.FindControl("hfDetail")
Dim hl As HyperLink = e.Row.FindControl("hlDetail")
hl.NavigateUrl = "~/Pages/DetailBon.aspx?id=" & hf.Value
lblvg = CType(row.FindControl("lblNBon"), Label)
lkbgv = CType(row.FindControl("lkbAnnuler"), LinkButton)
lkbgv.Visible = Not lkbgv.Visible
lkbgv.Attributes.Add("onclick", "return confirm('Confirmer la suppression du bon n°" & lblvg.Text & " ?'); ")
lkbgv = CType(row.FindControl("lkbRetablir"), LinkButton)
lkbgv.Attributes.Add("onclick", "return confirm('Confirmer le retablissement du bon n°" & lblvg.Text & " ?'); ")
row.Cells.Item(0).Font.Strikeout = lkbgv.Visible
row.Cells.Item(1).Font.Strikeout = lkbgv.Visible
row.Cells.Item(2).Font.Strikeout = lkbgv.Visible
row.Cells.Item(3).Font.Strikeout = lkbgv.Visible
row.Cells.Item(4).Font.Strikeout = lkbgv.Visible
End If
End Sub |
Partager