Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Column Headers in DataList


Message #1 by "Jesse Napier" <jnapier@r...> on Wed, 20 Mar 2002 20:01:01
I have created a datalist with horizontally repeating 7 columns.  I want 
custom headers for each of these columns but the <headertemplate> 
automatically  adds colspan="7" .  How can I prevent this and add 
something like; 
<headertemplate>
<tr><td>Sunday</td><td>Monday</td><td>Tuesday</td><td>Wednesday</td><td>
Thu
rsday</td><td>Friday</td><td>Saturday</td></tr>
</headertemplate>

Can I even do this?  Any help would be appreciated.

Jesse
Message #2 by Imar Spaanjaars <Imar@S...> on Wed, 20 Mar 2002 21:08:24 +0100
You could use a repeater. A repeater doesn't generate any code at all, 
except for the stuff you put inside the elements. It can be bound just like 
a datalist.
Here is a short example:

<ASP:Repeater id="repBooks" runat="server">
         <HeaderTemplate>
                 <table class="clsMyTable" cellpadding="0" cellspacing="0" 
width="100%">
                         <thead>
                         <tr>
                                 <td class="clsMyHeading">
                                         Item ID
                                 </td>
                                 <td class="clsMyHeading">
                                         Description
                                 </td>
                         </tr>
                         </thead>
                         <tbody>
         </HeaderTemplate>
         <ItemTemplate>
                 <tr class="clsMyRow">
                         <td class="clsMyCell">
                                 <%# DataBinder.Eval(Container.DataItem, 
"ID") %>
                         </td>
                         <td class="clsMyCell">
                                 <%# DataBinder.Eval(Container.DataItem, 
"Description") %>
                         </td>
                 </tr>
         </ItemTemplate>
         <FooterTemplate>
                 </tbody>
                 </table>
         </FooterTemplate>
</ASP:Repeater>

This will genrate a nice looking table with just the code you put inside 
the template elements.

HtH

Imar



At 08:01 PM 3/20/2002 +0000, you wrote:
>I have created a datalist with horizontally repeating 7 columns.  I want
>custom headers for each of these columns but the <headertemplate>
>automatically  adds colspan="7" .  How can I prevent this and add
>something like;
><headertemplate>
><tr><td>Sunday</td><td>Monday</td><td>Tuesday</td><td>Wednesday</td><td
>Thu
>rsday</td><td>Friday</td><td>Saturday</td></tr>
></headertemplate>
>
>Can I even do this?  Any help would be appreciated.
>
>Jesse


Message #3 by Ugo Bachetti <ubachetti@h...> on Wed, 20 Mar 2002 15:09:38 -0500
Hi,
	Can anyone help me?
	I have a datagrid that is bound to a SQL 2000 DB.  When I go to load
my data in the datagrid I always get the following error:

Timeout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding.
I have the following in web.config:

Web.config:
    <sessionState 
            mode="InProc"
            stateConnectionString="tcpip=127.0.0.1:42424"
            sqlConnectionString="data source=127.0.0.1;user id=sa;password="
            cookieless="false" 
            timeout="100" 
    /> 

What else do I need?


Thanks in advance,

Ugo
Message #4 by "McCloy, Russell" <Russell.McCloy@B...> on Thu, 21 Mar 2002 09:57:53 +1100
Is the query you are running just too big.
I get this error when I try and return too big a dataset.

RuSs

-----Original Message-----
From: Ugo Bachetti [mailto:ubachetti@h...]
Sent: Thursday, 21 March 2002 7:10 AM
To: ASP+
Subject: [aspx] RE: Column Headers in DataList


Hi,
	Can anyone help me?
	I have a datagrid that is bound to a SQL 2000 DB.  When I go to load
my data in the datagrid I always get the following error:

Timeout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding.
I have the following in web.config:

Web.config:
    <sessionState 
            mode="InProc"
            stateConnectionString="tcpip=127.0.0.1:42424"
            sqlConnectionString="data source=127.0.0.1;user id=sa;password="
            cookieless="false" 
            timeout="100" 
    /> 

What else do I need?


Thanks in advance,

Ugo


  Return to Index