1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
| Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
If tmp_i = 0 Then
Dim tbl As Table = CType(GridView1.Controls(0), Table)
Dim gvr As New GridViewRow(0, 0, DataControlRowType.EmptyDataRow, DataControlRowState.Normal)
gvr.Cells.Add(New TableCell())
gvr.Cells.Add(New TableCell())
gvr.Cells.Add(New TableCell())
tbl.Controls.AddAt(0, gvr)
gvr.Cells(0).ColumnSpan = 7
gvr.Cells(1).ColumnSpan = 7
gvr.Cells(2).ColumnSpan = 8
gvr.Cells(0).Text = String.Empty
gvr.Cells(0).BackColor = Drawing.Color.Transparent
gvr.Cells(1).Text = "Concentration mg/l"
gvr.Cells(1).Style.Add("color", "#FFFFFF")
gvr.Cells(1).Style.Add("background-color", "#1464FC")
gvr.Cells(1).Style.Add("text-align", "center")
gvr.Cells(1).Style.Add("border-right-color", "#FFFFFF")
gvr.Cells(1).Style.Add("border-right-width", "1px")
gvr.Cells(1).Style.Add("border-right-style", "solid")
gvr.Cells(2).Text = "Flux g/j"
gvr.Cells(2).Style.Add("color", "#FFFFFF")
gvr.Cells(2).Style.Add("background-color", "#1464FC")
gvr.Cells(2).Style.Add("text-align", "center")
Dim gvr2 As New GridViewRow(1, 1, DataControlRowType.EmptyDataRow, DataControlRowState.Normal)
For i = 0 To 21
gvr2.Cells.Add(New TableCell())
Next
tbl.Controls.AddAt(1, gvr2)
For i = 0 To 21
gvr2.Cells(i).Text = "TEST"
gvr2.Cells(i).Style.Add("text-align", "center")
Next
tmp_i = 1
End If
cur_familly = e.Row.Cells(0).Text
If cur_familly <> String.Empty Then
If cur_familly <> "FAMILLE" And cur_familly <> " " Then
If cur_familly <> old_familly Then
old_familly = cur_familly
Dim tbl As Table = CType(GridView1.Controls(0), Table)
Dim rowId As Integer = tbl.Rows.GetRowIndex(e.Row)
Dim gvr As New GridViewRow(rowId, rowId, DataControlRowType.EmptyDataRow, DataControlRowState.Normal)
gvr.Cells.Add(New TableCell())
tbl.Controls.AddAt(rowId, gvr)
gvr.Cells(0).Text = cur_familly
gvr.Cells(0).Style.Add("background-color", "#C0D4FA")
gvr.Cells(0).Style.Add("color", "#000000")
gvr.Cells(0).Style.Add("font-weight", "bold")
gvr.Cells(0).Style.Add("text-align", "center")
gvr.Cells(0).ColumnSpan = GridView1.Columns.Count
End If
End If
End If
For i As Integer = 7 To 10
Dim l_val As String = e.Row.Cells(i).Text
If l_val.StartsWith(" ") Then
e.Row.Cells(i).Text = String.Format("<span style=""color:red;"">{0}</span>", l_val)
End If
Next
For i = 2 To 21
e.Row.Cells(i).Style.Add("text-align", "center")
Next
End Sub |
Partager