Sometimes when tables display lots of data, it's difficult and cumbersome for the users to scroll back and forth to see which header corresponds to which column. I've developed a simple add-on control that will work with existing table type controls such as
For a live demo, check this link out.
Using the server control
GridSlideHeader server control is a very simple add-on control and can be added to existing
Simply call the
GridSlideHeader control and set the
DataGridID property that corresponds to the
DataList ID. That's it!
<form id="Form1" method="post" runat="server">
<asp:datagrid id="DataGridReport1" runat="server"
<EditItemStyle ForeColor="Black" BackColor="Yellow"></EditItemStyle>
<ItemStyle Font-Size="X-Small" Font-Names="Verdana"></ItemStyle>
<HeaderStyle Font-Bold="True" BackColor="#D7D7D7"></HeaderStyle>
HeaderText="Title_ID" SortExpression="Title_ID" />
<asp:BoundColumn DataField="Title" HeaderText="Title"
<asp:BoundColumn DataField="Price" HeaderText="Price"
HeaderText="Publication" SortExpression="Publication" />
<asp:BoundColumn DataField="Type" HeaderText="Type"
<asp:BoundColumn DataField="Authors" HeaderText="Authors"
runat="server" DataGridID="DataGridReport1" />
TR positions, the control sets the
TD positions of each header item. This was done to maintain the header borders. Lastly, I've been told this control is only compatible on IE platforms. Theoretically, it should be compatible on any browser that supports CSS positioning, but this is untested :P. Enjoy and let me know what bugs you find~...
Tony Truong graduated from UCLA in Spring of 2001 and starting worked at Symantec Corporation as a Software Engineer. After a few years of developing various features for Norton SystemWorks, Tony moved to San Diego. He is currently writing database applications using ASP.NET and C# with the .NET Framework. Tony specializes in tara-byte databases with emphasis on high availability, optimization, and complex entity modeling.