header template

  • Thread starter Thread starter vijaya
  • Start date Start date
V

vijaya

i want to bind data to the header template of template
column using any one of the web server controls like
button,textbox etc.

The data comes from the database through the sql select
statement, it shouldn't be a static text

Is it possible to bind data from a source like dataset ot
datatable to header template ?
Plz help me out

thanks in advance,
vijaya
 
Hi Vijaya,

Here's a sample.

The HTML

<asp:DataGrid id="DataGrid1" runat="server">
<Columns>
<asp:TemplateColumn>
<HeaderTemplate>
<asp:Button id="Button1" runat="server" Text='<%# GetText()
%>'></asp:Button>
</HeaderTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>


The code-behind

Protected Function GetText() As String
Return "hello"
End Function


Thank you, Mike
Microsoft, ASP.NET Support Professional

Microsoft highly recommends to all of our customers that they visit the
http://www.microsoft.com/protect site and perform the three straightforward
steps listed to improve your computer’s security.

This posting is provided "AS IS", with no warranties, and confers no rights.


--------------------
 
Back
Top