VBAHole22 Posted October 18, 2005 Posted October 18, 2005 Does anyone have any good links or information about using css in datagrids? I'm trying to make a professional looking datagrid but it's tough. There are attributes that can be applied in the html declaration of the datagrid (like CellPadding) but that seemingly can't be contained in a css style declaration. Is this true? Does anyone have a nice looking template that they want to share with me? I'll make you famous. Your name in lights. I don't want to go with one of those off the shelf formats. I'd rather do it myself. I just need a listing of the tags and what they do to help me out. Would I be better off creating my own datagrid deriving from the MS one? Thanks for any suggestions. I appreciate it. I realize it's lame to just beg for code but it would save me a ton of time and I have spent hours googling 'css datagrid' without much luck. Quote Wanna-Be C# Superstar
Nate Bross Posted October 18, 2005 Posted October 18, 2005 You may want to look into the repeater control. I have had much success with it vs. the datagrid. <asp:Repeater id="ExampleRepeater" runat="server"> <HeaderTemplate> <table cellpadding="0" cellspacing="0" width="780"> <tr> <td> <p class="title">Title for Shown Data</p> </td> </tr> </HeaderTemplate> <ItemTemplate> <tr bgcolor="ffffff"> <td> <p>Your Text Here</p> </td> </tr> </ItemTemplate> <AlternatingItemTemplate> <tr bgcolor="dcdcdc"> <td> <p>Your Text Here</p> </td> </tr> </AlternatingItemTemplate> <FooterTemplate> </table> </FooterTemplate> </asp:Repeater> This code seems to make errors in VS.NET, but when you run it it works anyway. I have not been able to determine why the errors are caused, all I know is that the code works for me. Quote ~Nate� ___________________________________________ Please use the [vb]/[cs] tags on posted code. Please post solutions you find somewhere else. Follow me on Twitter here.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.