User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 397,790 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,436 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 2691 | Replies: 2
Reply
Join Date: Dec 2006
Posts: 8
Reputation: SANJISH is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
SANJISH SANJISH is offline Offline
Newbie Poster

datagrid header height problem

  #1  
Jan 5th, 2007
i have managed to create a scrollable datagrid with fixed header.
The header doesnt scroll out of focus when i pull the scrollbar down.
However the height of the header increases or decreases depending on the number of records displayed. This is unacceptable to some of my customers and i am desperate to get a solution.

I am sure one of you could help me.

Thanks & regards

Sanjish
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2006
Posts: 91
Reputation: ses5909 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
ses5909 ses5909 is offline Offline
Junior Poster

Re: datagrid header height problem

  #2  
Jan 5th, 2007
Can you show us some code please?
Reply With Quote  
Join Date: Dec 2006
Posts: 8
Reputation: SANJISH is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
SANJISH SANJISH is offline Offline
Newbie Poster

Re: datagrid header height problem

  #3  
Jan 5th, 2007

i have used the following style for my datagrid fixed header
in the <HEAD> section of HTML source

[

<style type="text/css">

.DataGridFixedHeader { BORDER-RIGHT: #4a3c8c 1px solid; BORDER-TOP: #4a3c8c 1px solid; font-height:30; FONT-SIZE: .9em; BORDER-LEFT: #4a3c8c 1px solid; COLOR: blue; BORDER-BOTTOM: #4a3c8c 1px solid; FONT-FAMILY: Arial; POSITION: relative; ; TOP: expression(this.offsetParent.scrollTop -2); HEIGHT: 40px; BACKGROUND-COLOR: #c6d7cf }
.DataGridFixedPager { BORDER-RIGHT: #4a3c8c 1px solid; BORDER-TOP: #4a3c8c 1px solid; FONT-SIZE: .8em; BORDER-LEFT: #4a3c8c 1px solid; COLOR: blue; ; BOTTOM: expression(getScrollBottom(this.offsetParent)); BORDER-BOTTOM: #4a3c8c 1px solid; FONT-FAMILY: Arial; POSITION: relative; HEIGHT: 17px; BACKGROUND-COLOR: #c6d7cf }
BODYs { BACKGROUND-ATTACHMENT: fixed; BACKGROUND-IMAGE: url(../Images/buter.jpg); BACKGROUND-REPEAT: repeat-x }

</style>

]

Then i have defined the datgrid properties in the <BODY> section as follows

[

<divid="div2"style="OVERFLOW: auto; WIDTH: 840px; HEIGHT: 400px ; z-index: 900; left: 48px; position: absolute; top: 150px;"runat="server">
<
asp:datagridid="DataGrid1"OnSelectedIndexChanged="DataGrid1_SelectedIndexChanged"runat="server"BackColor="White"style="z-index: 905; left: 20px; top: 150px;"BorderColor="#DEBA84"BorderStyle="Solid"BorderWidth="1px"CellPadding="3"Width="800px"CellSpacing="2"Font-Bold="True"Font-Size="Smaller"Visible="False"PageSize="10"AutoGenerateColumns="True"Height="400px"ForeColor="Black">
<
ItemStyleCssClass="GridTD1"></ItemStyle>
<AlternatingItemStyleBackColor="BlanchedAlmond"Height="12px"ForeColor="Black"/>
<
SelectedItemStyleBackColor="#738A9C"Font-Bold="True"ForeColor="White"/>
<
HeaderStyleBackColor="#135A9C"Font-Bold="True"Font-Underline="False"ForeColor="White"HorizontalAlign="Center"CssClass="DataGridFixedHeader"Wrap="False"></HeaderStyle>
<
Columns>
<asp:ButtonColumn ButtonType="PushButton" CommandName="Select" Text="Select"></asp:ButtonColumn>
</
Columns>
</
asp:datagrid>
</
div>

]

I hope that helps

Thanks

Sanjish
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb ASP.NET Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 5:28 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC