0

For those of us who are aesthetically challenged, is there a way to apply JQuery's themes (e.g. redmond) to an ASP.NET gridview?

Something like ...

$(document).ready(function() { $(function() { $("<%= MyGridView.ClientID %>").Table(); }); });

Perhaps there's an addin that would emulate that type of functionality?

1

2 Answers 2

0

The gridview html renders to a table. If you add css class to it then you will be fine. Also, add the following in the gridview Databound event so the header does not render as a row.

protected void gridView_DataBound(object sender, EventArgs e)
    {
        if (gridView.Rows.Count > 0)
        {

            gridView.UseAccessibleHeader = true;

            gridView.HeaderRow.TableSection = TableRowSection.TableHeader;
            gridView.HeaderRow.CssClass = ///--Optional--
            gridView.FooterRow.TableSection = TableRowSection.TableFooter;
            gridView.PagerSettings.Visible = true; ///Helps footer
        }
    }
Sign up to request clarification or add additional context in comments.

1 Comment

0

Just give your gridview a css class and use that in the jquery selector. That way you can have a standard javascript file in all your pages and all you have to do is add the relevent css class to a gridview and it will be styled.

2 Comments

I had tried that but did see any difference. Is there a table-oriented class in any of the themes?
smashingmagazine.com/2008/08/13/top-10-css-table-designs Here are a couple table css examples that will work with the gridview

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.