Skip to content
This repository has been archived by the owner on Nov 19, 2022. It is now read-only.

Commit

Permalink
2003-01-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
Browse files Browse the repository at this point in the history
	* web_datagrid.aspx: simple datagrid test.

svn path=/trunk/xsp/; revision=10273
  • Loading branch information
gonzalop committed Jan 8, 2003
1 parent 97512c3 commit 6218685
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/ChangeLog
@@ -1,3 +1,7 @@
2003-01-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>

* web_datagrid.aspx: simple datagrid test.

2003-01-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>

* registertest.aspx:
Expand Down
89 changes: 89 additions & 0 deletions test/web_datagrid.aspx
@@ -0,0 +1,89 @@
<%@ Page Language="C#" %>
<html>
<head>
<title>DataGrid</title>
<style type="text/css">
<!--
.Normal
{
font-family: Verdana, Helvetica, sans-serif;
font-size: 11px;
font-weight: normal;
line-height: 12px
}
.Bold
{
font-family: Verdana, Helvetica, sans-serif;
font-size: 11px;
font-weight: bold
}
//-->
</style>
<script runat="server">
void Page_Load (object o, EventArgs e)
{
if (!IsPostBack) {
ArrayList list = new ArrayList ();
list.Add (new Datum ("Spain", "es", "Europe"));
list.Add (new Datum ("Japan", "jp", "Asia"));
list.Add (new Datum ("Mexico", "mx", "America"));
dg.DataSource = list;
dg.DataBind ();
}
}
public class Datum
{
private string country;
private string abbr;
private string continent;
public Datum (string country, string abbr, string continent)
{
this.country = country;
this.abbr = abbr;
this.continent = continent;
}
public string Country
{
get { return country; }
}
public string Abbr
{
get { return abbr; }
}
public string Continent
{
get { return continent; }
}
public override string ToString ()
{
return country + " " + abbr + " " + continent;
}
}
</script>
</head>
<body>
<h3>DataGrid sample</h1>
<form runat="server">
<asp:datagrid id="dg" border="1" AutoGenerateColumns="false"
EnableViewState="false" runat="server">
<Columns>
<asp:BoundColumn HeaderText="Country" DataField="Country"
ItemStyle-CssClass="Normal" HeaderStyle-Cssclass="Bold" />
<asp:BoundColumn HeaderText="Continent" DataField="Continent"
ItemStyle-CssClass="Normal" HeaderStyle-Cssclass="Bold"/>
<asp:BoundColumn HeaderText="Abbr" DataField="Abbr"
ItemStyle-CssClass="Normal" HeaderStyle-Cssclass="Bold"/>
</Columns>
</asp:datagrid>
</form>
</body>
</html>

0 comments on commit 6218685

Please sign in to comment.