We help IT Professionals succeed at work.
Get Started

Editable Gridview scroll bar

toooki
toooki asked
on
682 Views
Last Modified: 2012-05-12
I have this code in ASP.NET VS 2008 C#:

How do I keep the column header outside of the scroll bar in the Gridview? With this code if I scroll down the header row disappears...
Thanks.
<%@ Page Language="C#" .....>
   <style type='text/css'>
  
  .TextBoxGridViewNormal
   {
	border:solid 1px #EEE;
	/*text-align:center;*/	
	width:100%;
	height:100%;
    }
   .TextBoxGridViewEmpty
    {
	border:solid 1px #EEE;
	text-align: center;
	background-color: #CACAFF;	
	width:100%;
	height:100%;
    }      
    </style> 

 <asp:Panel ID="pnltop3" runat="server" Height="300px" style="width:60%;" ScrollBars="Auto">
                <table style="width:100%;">
                    <tr>
                    <td>
                    

                <asp:GridView ID="grd1" runat="server" AllowPaging="False" 
                CellPadding="5" CellSpacing="3" HeaderStyle-CssClass="headerRowGrid" GridLines="None"  
                            BorderWidth="1px" HeaderStyle-Wrap="false"  BorderColor="#EEEEEE"   RowStyle-CssClass="tableEvenRow"
                AlternatingRowStyle-CssClass="tableOddrow"
                AllowSorting="True" AutoGenerateColumns="False"
                <Columns> HeaderText="MyHeader"
.....
.....
 </Columns>

               </asp:GridView>
            

                    </td>
                    </tr>
                </table>
          </asp:Panel>

Open in new window

Comment
Watch Question
Project Lead
CERTIFIED EXPERT
Top Expert 2011
Commented:
This problem has been solved!
Unlock 2 Answers and 4 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE