•
•
•
•
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
![]() |
•
•
Join Date: Dec 2006
Posts: 8
Reputation:
Rep Power: 0
Solved Threads: 0
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
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
•
•
Join Date: Sep 2006
Posts: 91
Reputation:
Rep Power: 2
Solved Threads: 0
Can you show us some code please?
The Blog Experiment Forum - Join the Conversation!
brainyminds | ilovecode
Ultimate Merchant Account Resource
brainyminds | ilovecode
Ultimate Merchant Account Resource
•
•
Join Date: Dec 2006
Posts: 8
Reputation:
Rep Power: 0
Solved Threads: 0
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
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
- search in datagrid (C#)
- Data from datatable after datagrid sorting (VB.NET)
- Table height: 100% (HTML and CSS)
- Deleting a Row From A DataGrid (VB.NET)
- sizeof() for a Structure (C++)
- A php question (PHP)
- compile error-chained hash table c++ (C++)
Other Threads in the ASP.NET Forum
- Previous Thread: Rules, that FxCop cannot check
- Next Thread: calendar inside datagrid


Linear Mode