473,401 Members | 2,068 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,401 software developers and data experts.

How can I make a header column span?

I would like my header column span multiple columns, for example:

Date
Ready Open Close
---------------------------
08/06 10 am 5pm

How can I do that?

Thanks,

-Stan
Nov 17 '05 #1
5 1577
Are we talking about a DataGrid, or another server control, maybe , or a
basic HTML table, (or what)?
David Wier
http://aspnet101.com
http://aspexpress.com
"Stan" <no****@yahoo.com> wrote in message
news:ey**************@tk2msftngp13.phx.gbl...
I would like my header column span multiple columns, for example:

Date
Ready Open Close
---------------------------
08/06 10 am 5pm

How can I do that?

Thanks,

-Stan

Nov 17 '05 #2
DataGrid

"ElmoWatson" <sp**********@yahoo.com> wrote in message
news:Oe**************@TK2MSFTNGP09.phx.gbl...
Are we talking about a DataGrid, or another server control, maybe , or a
basic HTML table, (or what)?
David Wier
http://aspnet101.com
http://aspexpress.com
"Stan" <no****@yahoo.com> wrote in message
news:ey**************@tk2msftngp13.phx.gbl...
I would like my header column span multiple columns, for example:

Date
Ready Open Close
---------------------------
08/06 10 am 5pm

How can I do that?

Thanks,

-Stan


Nov 17 '05 #3
Hello,

How about nesting a datagrid in a template column of another datagrid?

HTH,

--
Parker Zhang
Microsoft Developer Support

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

Nov 17 '05 #4
Hmm...

Not sure I understood that...

The problem is that neither <asp:boundcolumn> no <asp:templatecolumn>
provide a way
of splitting a header colum:

Store ! Time
---- ----------------------------
! Open ! Close
---------------------------------
ABC 10 9
XYZ 11 5

Seems like it is impossible to do in datagrid...
"Parker Zhang [MSFT]" <pa******@online.microsoft.com> wrote in message
news:ki**************@cpmsftngxa06.phx.gbl...
Hello,

How about nesting a datagrid in a template column of another datagrid?

HTH,

--
Parker Zhang
Microsoft Developer Support

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

Nov 17 '05 #5
Hello,

Please have a look at the following code. It will clarify my post. I know
it is not the best anwser. but at least it works.

<asp:DataGrid id="DataGrid1" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:TemplateColumn HeaderText="Store">
<ItemTemplate>
<asp:DataGrid id=DataGrid2 runat="server" DataSource="<%#
MyDataSet1 %>" DataMember="YourTableName" AutoGenerateColumns="False">
<Columns>
<asp:BoundColumn DataField="Store"
SortExpression="Store"></asp:BoundColumn>
</Columns>
</asp:DataGrid>
</ItemTemplate>
</asp:TemplateColumn>

<asp:TemplateColumn HeaderText="Time">
<ItemTemplate>
<asp:DataGrid id=DataGrid3 runat="server" DataSource="<%#
MyDataSet1 %>" DataMember="YourTableName" AutoGenerateColumns="False">
<Columns>
<asp:BoundColumn DataField="Open"
SortExpression="Open" HeaderText="CompanyName"></asp:BoundColumn>
<asp:BoundColumn DataField="Close"
SortExpression="Close" HeaderText="ContactName"></asp:BoundColumn>
</Columns>
</asp:DataGrid>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
------------------------------------------------------

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
SqlDataAdapter1.Fill(MyDataSet1)
Dim values As ArrayList = New ArrayList()
values.Add(0)
DataGrid1.DataSource = values
DataGrid1.DataBind()
End Sub

Private Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
DataGrid1.ItemDataBound
Dim dg As DataGrid
dg = e.Item.FindControl("DataGrid2")
If Not dg Is Nothing Then
dg.DataBind()
End If
dg = e.Item.FindControl("DataGrid3")
If Not dg Is Nothing Then
dg.DataBind()
End If
End Sub


--
Parker Zhang
Microsoft Developer Support

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

Nov 17 '05 #6

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

Similar topics

6
by: Chuck | last post by:
I have a report with three columns, accross then down, and two groups. Currently the group headers are only one column wide and appear in the left hand column. How can I make the group header be...
1
by: sri_san | last post by:
Hello, I have a datagrid in which the header needs to span over 2 columns. I have tried creating a tableCells and tableRow at runtime and set the columnspan property of a cell to 2. But, the...
6
by: tshad | last post by:
I have a datagrid where each column has both a label and a linkbutton. I need to have the label left justified and the linkbutton right justified. In HTML, I would have to set up 2 cells to do...
1
by: soh chau hi via DotNetMonster.com | last post by:
I would like make my windows form datagrid (NOT Asp.net) header column span multiple columns, for example: Date Ready Open Close --------------------------- 08/06 10 am 5pm How can I do...
4
by: Mortar | last post by:
i need a datagrid with 2 header columns. The top one might have 1 column spanning 5 columns of the header row below it. what is the best way to do this? Could i have 2 datatables...1 filling the...
0
by: Mortar | last post by:
i am trying to span header columns and am getting some problems. I have 13 columns in my datagrid (1 template, 12 bound), and for some reason, when i try to remove cells of index 11 or higher, it...
4
by: tirath | last post by:
hi, I want to display data in on my web page, in gridview in this format: Group A Group B A1 A2 B1 B2 Test 1 1 2 1 2 Test 2 1 2 1 2 Group A is header to columns A1 and A2...
4
by: pedalpete | last post by:
I've just loaded some code up to my testing machine, and I get nothing but "cannot modify header" errors. I don't get these errors on my dev machine at all. I've gone through my code, and all...
0
by: krishnagovindaraj | last post by:
Hi, I have to create word document with header and footer..its working in web layout.In Print Layput,the header is displayed two times..Plz give me the solution...its very urgent.. strBody =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.