Repeat a header on a datagrid

dlsteve

New Member
Is this possible? <BR><BR>I have a report that I'd like the header on the datagrid to simply repeat every six lines. I can't seem to get it to work no matter what I do.<BR><BR>Thanks,<BR>paulHave you tried another control, such as the DataRepeater? Or are you bound by business case to the DataGrid?I thought the Repeater control might have something that the DataGrid didn't. doesn't look like it<BR>:::mumble, mumble::: should think before I post!The Code.<BR><%@ Import Namespace="System.Data" %><BR><%@ Import Namespace="System.Data.OleDb" %><BR><%@ Import Namespace="System.Xml" %><BR><%@ Import Namespace="System.Xml.Xsl" %><BR><script language="VB" runat="server"><BR>sub Page_Load(sender as Object, e as EventArgs)<BR>GetData()<BR>end sub<BR><BR>Sub GetData()<BR>Dim strConn as string<BR>strConn = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" & _<BR>"C:InetpubwwwrootNETDevdataDemo.mdb;"<BR>'Open a connection<BR>Dim conn as OleDbConnection<BR>conn = new OleDbConnection(strConn)<BR>conn.open()<BR><BR>'specify your SQL<BR>Dim strSQL as string<BR>strSQL = "SELECT UserID, UserFName, UserMI, UserLName, UserEmail FROM tblUser"<BR><BR>Dim dst AS dataset<BR>dst = new dataset()<BR><BR>Dim odad as OledBDataAdapter<BR>odad = New OledBDataAdapter(strSQL, conn)<BR>odad.Fill(dst, "Users")<BR><BR>XMLUsers.Document = New XmlDataDocument(dst)<BR>XMLUsers.TransformSource = "Perf.xsl"<BR><BR>conn.close()<BR><BR>End Sub<BR><BR></script><BR><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><BR><HTML><BR><HEAD><BR><TITLE> Six! </TITLE><BR><META NAME="Generator" CONTENT="EditPlus"><BR><META NAME="Author" CONTENT="Avitar"><BR></HEAD><BR><BODY><BR><asp:Xml ID="XMLUsers" Runat="Server" /><BR><BR></BODY><BR><BR>......<BR>The xsl<BR><BR><xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'><BR><xsl:template match="/"><BR><style> <BR>.value { width:"25%";font-family:courier new; font-size:.8em; white-space=pre;} <BR></style><BR><table border="1" cellspacing="0" cellpadding="3" bordercolor="gainsboro"><BR><xsl:for-each select='NewDataSet/Users'><BR><xsl:variable name="myVar" select="position() mod 5=1" /><BR><xsl:choose><BR><xsl:when test='$myVar'><BR><tr><BR><th>ID</th><BR><th>First Name</th><BR><th>MI</th><BR><th>Last Name</th><BR><th>Email</th><BR></tr><BR></xsl:when><BR><xsl:otherwise> <BR></xsl:otherwise><BR></xsl:choose><BR><tr><BR><td class="value"><em><xsl:value-of select='UserID'/></em></td><BR><td class="value"><xsl:value-of select='UserFName'/></td><BR><td class="value"><xsl:value-of select='UserMI'/></td><BR><td class="value"><xsl:value-of select='UserLName'/></td><BR><td class="value"><xsl:value-of select='UserEmail'/></td><BR></tr><BR></xsl:for-each><BR></table><BR></xsl:template><BR></xsl:stylesheet><BR>......<BR>Bibliography (casual)<BR>http://www.dotnet101.com/articles/art027_UsingXMLASP1.asp by Scott Guthrie<BR><BR><b>ASP.NET Unleased</b> by Stephen Walther<BR><BR><a target="_blank" href=http://aspmessageboard.com/archive/index.php/"http://www.w3c.org/tr/xpath">The w3c standards on XPath, etc.</a><BR>Sorry for the cruddy biblio. Please let me know if this works for you. Thanks -A-
 
Back
Top