Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7787385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:38:58+00:00 2026-06-01T20:38:58+00:00

So my existing structure is <table> <tr> <th>header</th> </tr> <tr> <td>cotent</td> </tr> </table> The

  • 0

So my existing structure is

<table>
<tr>
    <th>header</th>
</tr>
<tr>
    <td>cotent</td>
</tr>
</table>

The DataGrid is adding a bunch of stuff I do not desire to be there, is it possible to remove this extra information so I don’t have to make heavy modifications to my CSS file?

Here is how the above table looks after DataGrid.

<table id="ContentPlaceHolder1_articleList" headertext="File Name" rules="all">
    <tr>
        <td>Header</td> <!-- I need this to be a TH?? -->
    </tr>
    <tr>
        <td>Content</td>
    </tr>
</table>

The biggest issue here is I need the header row to be <th> and not <td>. And I need the table to just be the ID and runat="server" are not big deals, not sure what the rules="all" does.

Here is my asp.net code.

Code Behind Page_Load:

protected void Page_Load(object sender, EventArgs e)
{
    DirectoryInfo dirInfo = new DirectoryInfo(Server.MapPath("examfilemanager"));

    articleList.DataSource = dirInfo.GetFiles();
    articleList.DataBind();
}

aspx page:

<asp:DataGrid Enabled="false" runat="server" ID="articleList" AutoGenerateColumns="false" AlternatingItemStyle-BackColor="#EEEEEE" HeaderText="File Name">
    <Columns>
        <asp:HyperLinkColumn DataNavigateUrlField="Name" DataTextField="Name" HeaderText="File Name" />
        <asp:BoundColumn DataField="LastWriteTime" HeaderText="Last Write Time" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
        <asp:BoundColumn DataField="Length" HeaderText="Filer Server" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,### bytes}" />
    </Columns>
</asp:DataGrid>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T20:39:00+00:00Added an answer on June 1, 2026 at 8:39 pm

    Try setting UseAccessibleHeader to true:

    <asp:DataGrid ID="DataGrid1" runat="server" UseAccessibleHeader="true" ...>
    

    If possible you really should use the GridView control instead and take advantage of the many features that aren’t available to the DataGrid control. The traditional DataGrid control is more of an antiquated relic at this point.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The DOM structure looks like this (existing website ... cant modify it): <table> <tr><td>
Existing table structure CREATE TABLE [MYTABLE]( [ROW1] [numeric](18, 0) NOT NULL, [ROW2] [numeric](18, 0)
I'm trying to implement EF with an existing table structure that I'm not allowed
I have an existing table structure that looks something like this: AnimalTable ------------- |Id
I have a table with this structure: [ID] [int] IDENTITY(1,1) NOT NULL, [ParentID] [int]
I haven't found a similar table structure in existing questions yet so I'm hoping
I'm looking to set up a tag system using this normalised table structure: Table:
I have no clue how i can get an existing object structure based on
Reading existing code at work, I wondered how come this could work. I have
Are there any existing libraries in existence that will parse a datetime from a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.