Tak jsem zatím pokročil do tohoto stádia: Výpis Default.aspx.vb
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim oDs As New DataSet
oDs.ReadXml(Request.PhysicalApplicationPath + "XMLFile.xml")
GridView1.DataSource = oDs
GridView1.DataBind()
'GridView1.FooterRow.Cells(1).Text = "NIC"
End Sub
Protected Sub GridView1_RowCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowCreated
If e.Row.RowType = DataControlRowType.Footer Then
Dim oCell As New TableCell
oCell.ColumnSpan = 2
e.Row.Cells.Clear()
oCell.Text = "Merged header"
e.Row.Cells.Add(oCell)
'append the content of cell # 2 to cell #1
End If
End Sub
Výpis XMLfile.xml:
<Mitarbeiter>
<ma>
<id>1</id>
<name>Florian</name>
<phone>123</phone>
</ma>
<ma>
<id>2</id>
<name>Andreas</name>
<phone>234</phone>
</ma>
<ma>
<id>3</id>
<name>Martin</name>
<phone>345</phone>
</ma>
</Mitarbeiter>
Výpis default.aspx
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server"
Style="left: 99px; position: relative; top: 16px" ShowFooter="True">
</asp:GridView>
</div>
</form>
</body>
Podaří se tak jak má,ale prostě zakomentovaný řádek 'GridView1.FooterRow.Cells(1).Text = "NIC" nejde,protože index ukazuje správně,ale asi buňka neexistuje. Můžete mi prosím poradit,co s tím.
|