datalist fxied header

I want to make a fixed header for my datalist.
I am trying to use this
http://www.codeproject.com/KB/webforms/DataGridFixedHeader.aspx
but doesn't seem to work.
Any help appreciated
Angela4evaAsked:
Who is Participating?
 
DesignbyonyxConnect With a Mentor Commented:
ah, cool.  So you ideally want to use markup like this, which is both semantic (meaningful) and helps achieve your goal.

<table>
  <thead>
    <tr>
      <th>This is a header for column 1</th>
      <th>This is a header for column 2</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>This is data in data row 1 column 1</td>
      <td>This is data in data row 1 column 2</td>
    </tr>
    <tr>
      <td>This is data in data row 2 column 1</td>
      <td>This is data in data row 2 column 2</td>
    </tr>
  </tbody>
</table>

Then, you will need to do some CSS magic.  This can best be explained if you view source on this page:

http://www.imaputz.com/cssStuff/bigFourVersion.html

One major drawback of this is the fact that your columns have to have fixed widths.  If your table has fewer than 4 columns, then it might be easier to use DIVs.  Hope that helps.
0
 
DesignbyonyxCommented:
You gave us nothing by which to help you.  Code please...  A URL is even better.
0
 
Angela4evaAuthor Commented:
<ItemTemplate>
                                 <tr >

                                <td ><b>
                                        <asp:Label ID="mdesc" runat="server" Text='<%# Eval("Comp").ToString() + ". " + Eval("ComtDesc").ToString() + " " %>' ></asp:Label>                                        
                                        <asp:HiddenField ID="hdesc" runat="server" Value='<%# DataBinder.Eval(Container, "DataItem.CompGUID") %>' />

                                    </b></td>
                                 </tr>
                                 <tr ><td>
                                        <asp:Literal ID="mylistList" runat="server"></asp:Literal>
                                        <asp:HiddenField ID="HiddenField1" runat="server" />
                                    </td>
                                </tr>
                            </ItemTemplate>



I want to keep below part always fixed. just this row.
 <tr >

                                <td ><b>
                                        <asp:Label ID="mdesc" runat="server" Text='<%# Eval("Comp").ToString() + ". " + Eval("ComtDesc").ToString() + " " %>' ></asp:Label>                                        
                                        <asp:HiddenField ID="hdesc" runat="server" Value='<%# DataBinder.Eval(Container, "DataItem.CompGUID") %>' />

                                    </b></td>
                                 </tr>
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

 
DesignbyonyxCommented:
So the example you referenced gives an example of a fixed "header".  You seem to want to have a fixed "row", whcih is a little weird since it seems to appear in the middle of your data as opposed to the top (header).  Would you mind describing your data and your desired solution?  Thanks.
0
 
Angela4evaAuthor Commented:
I want to fix the fisrt row
0
 
DesignbyonyxCommented:
Just noting that that solution does not work too well with IE.  Looks like you might need to use javascript to get the desired results.  Check out this jQuery plugin:

http://fixedheadertable.com
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.