0

I am considering the feasibility of using jQuery UI themes to my ASP.NET website.

I found following issues. How do we correct them?

  1. Internet Explorer (IE 8) --> The gridline is not visible at the bottom (when there is no multiple pages)
  2. Mozilla --> Gridline is not available for header
  3. Chrome --> Working fine

Is it compatible with asp.net controls? Can you please direct me to some examples that shows correct use of these jQuery classes with asp.net controls (without side effects)?

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

<title></title>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.4.4.js"></script>

<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.6/jquery-ui.js"></script>

<link href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.13/themes/sunny/jquery-ui.css"
    rel="stylesheet" type="text/css" />

</head>
<body>
<form id="form1" runat="server">
<div>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        AllowPaging="True"  PageSize="4">
        <Columns>
            <asp:BoundField DataField="ProductName" HeaderText="ProductName" ReadOnly="true"
                SortExpression="ProductName" />
            <asp:BoundField DataField="QuantityPerUnit" HeaderText="Qty" ReadOnly="true" SortExpression="QuantityPerUnit" />
            <asp:BoundField DataField="CategoryName" HeaderText="Category" ReadOnly="true" SortExpression="CategoryName" />
        </Columns>
    </asp:GridView>
</div>
<br />
</form>
</body>
</html>

--Code Behind

using System;
using System.Web.UI.WebControls;
using System.Data;

public partial class MyGridTest : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
    DataTable dt = new DataTable();
    dt.Columns.AddRange(new DataColumn[3] { new DataColumn("ProductName"), new DataColumn("QuantityPerUnit"), new DataColumn("CategoryName") });
    dt.Rows.Add("Shirt", 200);
    dt.Rows.Add("Football", 30);
    dt.Rows.Add("Bat", 22.5);
    //dt.Rows.Add("Football", 30);
    //dt.Rows.Add("Bat", 22.5);
    //dt.Rows.Add("Football", 30);
    //dt.Rows.Add("Bat", 22.5);
    GridView1.DataSource = dt;
    GridView1.DataBind();
}

protected override void OnPreRender(EventArgs e)
{
    base.OnPreRender(e);
    GridView1.CssClass = "ui-widget-content";

    if (GridView1.Rows.Count > 0)
    {
        //To render header in accessible format
        GridView1.UseAccessibleHeader = true;

        //Add the <thead> element
        GridView1.HeaderRow.TableSection = TableRowSection.TableHeader;
        GridView1.HeaderRow.CssClass = "ui-widget-header";

        //Add the <tfoot> element
        GridView1.FooterRow.TableSection = TableRowSection.TableFooter;


        if (GridView1.TopPagerRow != null)
        {
            GridView1.TopPagerRow.TableSection = TableRowSection.TableHeader;
        }
        if (GridView1.BottomPagerRow != null)
        {
            GridView1.BottomPagerRow.TableSection = TableRowSection.TableFooter;
        }
        }
    }
}
2
  • Anybody able to reproduce this issue? Commented Feb 8, 2012 at 4:10
  • What version of .Net are you using? Commented Feb 10, 2012 at 16:06

1 Answer 1

2

Just out of interest. What happens on when you add this meta tag.

<meta http-equiv="x-ua-compatible" content="IE=8" />
Sign up to request clarification or add additional context in comments.

1 Comment

Or better, content="IE=edge"; see here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.