Duomenų pakrovimas iš DataTable:
Me.dgTrainingMatrix.DataSource = objDT
Me.dgTrainingMatrix.DataBind()
Norint, sudėti stilius, reikia juos dėti prie dgTrainingMatrix įvykyje ItemDataBound:
Protected
Sub dgTrainingMatrix_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgTrainingMatrix.ItemDataBound
If e.Item.ItemType = ListItemType.Header Then
For i = 1 To e.Item.Cells.Count - 1
Dim oCell As TableCell = e.Item.Cells(i)
oCell.Text = "< div style= "" writing-mode:tb-rl"" >" & oCell.Text & " < / div > "
oCell.Attributes.Add("height", "150px")
oCell.Attributes.Add("width", "30px")
oCell.Attributes.Add("valign", "bottom")
oCell.Attributes.CssStyle.Add("overflow", "hide")
oCell.Attributes.CssStyle.Add("width", "30px")
Next
End If
End Sub
Komentarų nėra:
Rašyti komentarą