S
SK
Hello,
does anybody know how I can add an additional row above
the datagrid header?
does anybody know how I can add an additional row above
the datagrid header?
-----Original Message-----
Here's some code to show two headers:
<aspataGrid id="DataGrid1" runat="server" AutoGenerateColumns="False"
ShowHeader="False">
<Columns>
<asp:BoundColumn
= "http://www.gc.ca/images/flag.gif"DataField="Subject"> said:<asp:BoundColumn DataField="Day"></asp:BoundColumn>
</Columns>
</aspataGrid>
Dim dt As DataTable
Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
DataGrid1.ShowHeader = True
DataGrid1.DataSource = CreateDataSource()
DataGrid1.DataBind()
End Sub
Private Sub DataGrid1_ItemDataBound _
(ByVal sender As Object, _
ByVal e As _
System.Web.UI.WebControls.DataGridItemEventArgs) _
Handles DataGrid1.ItemDataBound
' Add a second header with a flag button in it
' by Ken Cox Microsoft MVP [ASP.NET]
If e.Item.ItemType = ListItemType.Header Then
' Get the collection of cells from the grid
Dim tcells As TableCellCollection
' Create an imagebutton
Dim imgBtn As New ImageButton
' Assign the URL
imgBtn.ImageUrl
-----Original Message-----
Here's some code to show two headers:
<aspataGrid id="DataGrid1" runat="server" AutoGenerateColumns="False"
ShowHeader="False">
<Columns>
<asp:BoundColumn
= "http://www.gc.ca/images/flag.gif"DataField="Subject"> said:<asp:BoundColumn DataField="Day"></asp:BoundColumn>
</Columns>
</aspataGrid>
Dim dt As DataTable
Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
DataGrid1.ShowHeader = True
DataGrid1.DataSource = CreateDataSource()
DataGrid1.DataBind()
End Sub
Private Sub DataGrid1_ItemDataBound _
(ByVal sender As Object, _
ByVal e As _
System.Web.UI.WebControls.DataGridItemEventArgs) _
Handles DataGrid1.ItemDataBound
' Add a second header with a flag button in it
' by Ken Cox Microsoft MVP [ASP.NET]
If e.Item.ItemType = ListItemType.Header Then
' Get the collection of cells from the grid
Dim tcells As TableCellCollection
' Create an imagebutton
Dim imgBtn As New ImageButton
' Assign the URL
imgBtn.ImageUrl
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.