A
Alan Campbell
Hi,
I am developing an application which displays a large number of
columns and a relatively small number of rows so it makes sense to
display them horizontally.
This is straightforward enough but no matter what I try, I can't get
the rows to align horizontally so it is impossible for the user to
scan along each line.
I know that effectively I have a separate table for each row which is
the problem but I can't think of an alternative way to do this.
This is best explained by a small sample -
<<< FORM BELOW >>>
<asp
ataList ID="myDataList" Runat=server RepeatColumns=5>
<ItemTemplate>
<table>
<tr><td><%# Container.DataItem("au_lname") %></td></tr>
<tr><td><%# Container.DataItem("au_id") %></td></tr>
<tr><td><%# Container.DataItem("address") &
Container.DataItem("address") & Container.DataItem("address")
%></td></tr>
</table>
</ItemTemplate>
</asp
ataList>
<<< CODEBEHIND BELOW >>>
Imports System.data
Imports System.data.sqlclient
Public Class test2
Inherits System.Web.UI.Page
Protected WithEvents MyDataList As
System.Web.UI.WebControls.DataList
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim DS As DataSet
Dim MyConnection As SqlConnection
Dim MyCommand As SqlDataAdapter
MyConnection = New
SqlConnection("server=server;uid=uid;pwd=pwd;database=pubs")
MyCommand = New SqlDataAdapter("select * from Authors",
MyConnection)
DS = New DataSet
MyCommand.Fill(DS, "Authors")
MyDataList.DataSource = DS.Tables("Authors").DefaultView
MyDataList.DataBind()
End Sub
End Class
Also, has anyone got any idea how to display "headings" on the left
hand side and even better - allow the data to scroll while the
"headings" stay fixed - something like freezing panes in Excel?.
Any help you can give is greatly appreciated!.
Alan.
I am developing an application which displays a large number of
columns and a relatively small number of rows so it makes sense to
display them horizontally.
This is straightforward enough but no matter what I try, I can't get
the rows to align horizontally so it is impossible for the user to
scan along each line.
I know that effectively I have a separate table for each row which is
the problem but I can't think of an alternative way to do this.
This is best explained by a small sample -
<<< FORM BELOW >>>
<asp

<ItemTemplate>
<table>
<tr><td><%# Container.DataItem("au_lname") %></td></tr>
<tr><td><%# Container.DataItem("au_id") %></td></tr>
<tr><td><%# Container.DataItem("address") &
Container.DataItem("address") & Container.DataItem("address")
%></td></tr>
</table>
</ItemTemplate>
</asp

<<< CODEBEHIND BELOW >>>
Imports System.data
Imports System.data.sqlclient
Public Class test2
Inherits System.Web.UI.Page
Protected WithEvents MyDataList As
System.Web.UI.WebControls.DataList
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim DS As DataSet
Dim MyConnection As SqlConnection
Dim MyCommand As SqlDataAdapter
MyConnection = New
SqlConnection("server=server;uid=uid;pwd=pwd;database=pubs")
MyCommand = New SqlDataAdapter("select * from Authors",
MyConnection)
DS = New DataSet
MyCommand.Fill(DS, "Authors")
MyDataList.DataSource = DS.Tables("Authors").DefaultView
MyDataList.DataBind()
End Sub
End Class
Also, has anyone got any idea how to display "headings" on the left
hand side and even better - allow the data to scroll while the
"headings" stay fixed - something like freezing panes in Excel?.
Any help you can give is greatly appreciated!.
Alan.