Click here to Skip to main content
15,886,199 members
Articles / Web Development / ASP.NET

Add a Tree Menu to DataGrid Header Text

Rate me:
Please Sign up or sign in to vote.
4.67/5 (15 votes)
9 Nov 2005CPOL1 min read 75.4K   1.3K   78  
This article shows how to add a JavaScript tree menu to a DataGrid head text.
<%@ Page language="c#" Codebehind="HeaderTextWithTreeMenu.aspx.cs" AutoEventWireup="false" Inherits="DataGridWithTreeMesu.HeaderTextWithTreeMenu" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>HeaderTextWithTreeMenu</title>
		<meta content="Microsoft Visual Studio 7.0" name="GENERATOR">
		<meta content="C#" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
	</HEAD>
	<body MS_POSITIONING="GridLayout">
		<form id="HeaderTextWithTreeMenu" method="post" runat="server">
			<asp:Button ID="bnDate" style="DISPLAY: none" Runat="server"></asp:Button>
			<asp:DataGrid id="DataGrid1" Font-Size="12pt" EnableViewState="False" BorderWidth="2px" BorderColor="#CC9966" CellPadding="2" style="Z-INDEX: 101; LEFT: 100px; POSITION: absolute; TOP: 47px" runat="server" AutoGenerateColumns="False">
				<Columns>
					<asp:BoundColumn DataField="LastName" HeaderText="Last Name" ItemStyle-Width="150px"></asp:BoundColumn>
					<asp:BoundColumn DataField="FirstName" HeaderText="First Name" ItemStyle-Width="150px"></asp:BoundColumn>
					<asp:BoundColumn DataField="Date" HeaderText="_Date" ItemStyle-Width="150px"></asp:BoundColumn>
				</Columns>
			</asp:DataGrid></form>
	</body>
</HTML>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
United States United States
M.S.: Computer Science, B.S.: Physics, MCSD: .NET, MCSD: VS 6

Florence currently works at Confident Software, Inc. Atlanta, U.S.A. Besides programming, during her spare time she enjoys opera.

Comments and Discussions