Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > HeaderTemplate in GridView

Reply
Thread Tools

HeaderTemplate in GridView

 
 
=?Utf-8?B?SmliZXkgSmFjb2I=?=
Guest
Posts: n/a
 
      01-24-2007
Hi:

I placed an <asp:Table> inside the HeaderTemplate of a TemplateField of a
GridView. The contents of the <asp:Table just doesn't show up. Can someone
please tell me why?

Thanks,

Jibey

<asp:GridView Width="100%" CellPadding="0"
CellSpacing="0" BorderStyle="none" ID="gvApps" runat="server"
AllowPaging="false" PageSize="1"
OnPageIndexChanging="gvApps_PageIndexChanging" AutoGenerateColumns="False"
ShowHeader="false" OnRowDataBound="gvApps_RowDataBound">
<PagerSettings Visible="True" />
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:TemplateField
ConvertEmptyStringToNull="False">
<HeaderTemplate>
<asp:Table ID="tblHeader" runat="server"
CellPadding="0" CellSpacing="0" Width="100%">
<asp:TableRow runat="server">
<asp:TableCell Font-Bold="true"
Text="Application Mnemonic and Name" runat="server" RowSpan="2" Width="25%"
HorizontalAlign="center" VerticalAlign="middle" >
</asp:TableCell>
<asp:TableCell Font-Bold="true"
Text="Application Business Value" runat="server" RowSpan="2" Width="20%"
HorizontalAlign="center" VerticalAlign="middle" >
</asp:TableCell>
<asp:TableCell Font-Bold="true"
Text="Level of Risk" runat="server" ColumnSpan="3" HorizontalAlign="center"
Width="55%" >
</asp:TableCell>
</asp:TableRow>
<asp:TableRow runat="server">
<asp:TableCell Font-Bold="true"
Text="Current" runat="server" HorizontalAlign="center" Width="19%" >
</asp:TableCell>
<asp:TableCell Font-Bold="true"
Text="Next Year" runat="server" HorizontalAlign="center" Width="18%" >
</asp:TableCell>
<asp:TableCell Font-Bold="true"
Text="In 2 Years" runat="server" HorizontalAlign="center" Width="18%" >
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</HeaderTemplate>
<ItemTemplate>

The rest of the code is omitted for clarity.

Please help!
 
Reply With Quote
 
 
 
 
=?Utf-8?B?SmliZXkgSmFjb2I=?=
Guest
Posts: n/a
 
      01-24-2007
Actually, the problem is that the ShowHeader property of the gridview is set
to false.

But I have another problem now. My <asp:Table> in the <HeaderTemplate> of
the gridview doesn't have a border and no matter what I do, it just doesn't
work.

Please help.

Thanks.

"Jibey Jacob" wrote:

> Hi:
>
> I placed an <asp:Table> inside the HeaderTemplate of a TemplateField of a
> GridView. The contents of the <asp:Table just doesn't show up. Can someone
> please tell me why?
>
> Thanks,
>
> Jibey
>
> <asp:GridView Width="100%" CellPadding="0"
> CellSpacing="0" BorderStyle="none" ID="gvApps" runat="server"
> AllowPaging="false" PageSize="1"
> OnPageIndexChanging="gvApps_PageIndexChanging" AutoGenerateColumns="False"
> ShowHeader="false" OnRowDataBound="gvApps_RowDataBound">
> <PagerSettings Visible="True" />
> <AlternatingRowStyle BackColor="White" />
> <Columns>
> <asp:TemplateField
> ConvertEmptyStringToNull="False">
> <HeaderTemplate>
> <asp:Table ID="tblHeader" runat="server"
> CellPadding="0" CellSpacing="0" Width="100%">
> <asp:TableRow runat="server">
> <asp:TableCell Font-Bold="true"
> Text="Application Mnemonic and Name" runat="server" RowSpan="2" Width="25%"
> HorizontalAlign="center" VerticalAlign="middle" >
> </asp:TableCell>
> <asp:TableCell Font-Bold="true"
> Text="Application Business Value" runat="server" RowSpan="2" Width="20%"
> HorizontalAlign="center" VerticalAlign="middle" >
> </asp:TableCell>
> <asp:TableCell Font-Bold="true"
> Text="Level of Risk" runat="server" ColumnSpan="3" HorizontalAlign="center"
> Width="55%" >
> </asp:TableCell>
> </asp:TableRow>
> <asp:TableRow runat="server">
> <asp:TableCell Font-Bold="true"
> Text="Current" runat="server" HorizontalAlign="center" Width="19%" >
> </asp:TableCell>
> <asp:TableCell Font-Bold="true"
> Text="Next Year" runat="server" HorizontalAlign="center" Width="18%" >
> </asp:TableCell>
> <asp:TableCell Font-Bold="true"
> Text="In 2 Years" runat="server" HorizontalAlign="center" Width="18%" >
> </asp:TableCell>
> </asp:TableRow>
> </asp:Table>
> </HeaderTemplate>
> <ItemTemplate>
>
> The rest of the code is omitted for clarity.
>
> Please help!

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
accessing GridView headerTemplate Andy B ASP .Net 1 08-05-2008 05:59 AM
Does the GridView have a HeaderTemplate? jm ASP .Net 0 10-23-2006 02:20 PM
button in headertemplate of gridview =?Utf-8?B?Tkg=?= ASP .Net 3 04-07-2006 02:35 PM
Can we bind data to textbox in a headertemplate of a datagrid Vijaya ASP .Net 2 11-13-2003 06:42 AM
How do you access controls in the HeaderTemplate of a DataGrid SamIAm ASP .Net 1 06-26-2003 09:04 AM



Advertisments