473,399 Members | 3,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

HeaderTemplate in GridView

Hi:

I placed an <asp:Tableinside 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!
Jan 24 '07 #1
1 22887
Actually, the problem is that the ShowHeader property of the gridview is set
to false.

But I have another problem now. My <asp:Tablein the <HeaderTemplateof
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:Tableinside 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!
Jan 24 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Congero | last post by:
I'm trying to find a way to bind hierarchical data to a gridview control. I've been able to do this with some third party controls and was wondering if this functionality is available with the...
2
by: bigbrorpi | last post by:
Hi I have a FormView that contains a GridView. The GridView is populated from an ObjectDataSource. Two of the columns in the GridView are not bound, and the values used in Update mode come from...
3
by: NH | last post by:
I have this peice of code in my gridview <HeaderTemplate> <asp:ImageButton ID="btnPrevious" ImageUrl="~/Images/Calendar/ico_Previous.png" runat="server" /> <asp:ImageButton ID="btnNext"...
4
by: Marcos Beccar Varela | GamaCom Argentina | last post by:
Hello Everyone. I need to use a gridview, that when I use the Update command one of the colums, instead of showing a textbox where the user can write, I need a combobox (listobx), where there are...
1
by: Jeff | last post by:
ASP.NET 2.0 I've got problems with the right column in my GridView. The GridView consist of 2 columns, the problem column is the column on the right side. The problem is that it looks like...
8
by: Jeff | last post by:
ASP.NET 2.0 I have a webpage which contains a GridView. I want this GridView's HeaderTemplate to display the text "Inbox" or "Outbox"... So I think I need to set the value in the code behind...
0
by: sharonrao123 | last post by:
hello all, I have a parent gridview company and in this one a nested gridview people, Is it possible to allow the user to select one row or multiple rows from the people gridview using a check box...
0
parshupooja
by: parshupooja | last post by:
Hi all, I need help. I am using asp.net C# . I have binded gridview with 5 columns. I have Dropdownlist in 4 columns Morning in, morning out, afternoon in and afternoon out and label in 5 column...
1
nitindel
by: nitindel | last post by:
Hi All, Please tell me any good site for Gridview control.(not for datagrid). I am facing error in fetching the values of the Bound columns in the gridview: lease tell me how should i...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.