Freeze Headers(Multiple row headers) in GridView

Hello all,

 

     I'm developing web application with asp.net2.0+C#.

 

Requirement :

  1. GridView with Multiple Header rows.
  2. When vertical scroll, headers freeezed (GridView rows only scrollable).
  3. When horizontal scroll, GridView's 1st column freezed (1st Column of GridView is freezed & remaining columns with Headers should be scrollable).

Something like as:-

 

School Name:- ABC English School

Academic Year:- 2007-2008

 

Type

 

OPEN

 

S.C.

 

N.T.

 

O.B.C.

Boys

Girls

Boys

Girls

Boys

Girls

Boys

Girls

Handicapped

1

0

0

0

0

0

0

0

Blind

0

0

0

0

0

1

0

0

Dumb

0

0

0

0

0

0

0

0

 

 

 

 

 

 

 

 

 

 

When i scroll vertically, i want to freeze 1st 3 rows (Headers with School Name, Type, Boys/Girls).

& when i scroll horizontally, i want to freeze column containing data, "Handicapped, Blind, Dumb".

 

Is it possible?

 

 

For multiple headers, i made workaround using table & GridView like:-

For Headers i used asp:Table & for data, i used GridView with header invisible.

I succeeded to create screen like above but now Scrolling requirement still remaing.

 

Is there any other way to design above screen & fullfill Scrolling requirement?

 

Thanks

 

SAMEER

0
sameer_abhang
7/18/2008 7:54:21 AM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

3 Replies
1269 Views

Similar Articles

[PageSpeed] 40

 you can but your grid inside a div and give the div scrolling option and show scrollers ( you must give div a constant hieght). ( but i do not remember if it works for firefox or not).

the other way is to create the header as a table and create the body on your code behind and again use a div for that. or iframe ( but i do not recommand iframe).

hope this helps


Muhanad YOUNIS
MCSD.NET
My Blog || My Photos || LinkedIn

0
mohi88
7/18/2008 8:22:07 AM

Hai Sameer It is possible sure....I think u can do it using simple CSS..as u know gridview contains <tr> and <td> Look into the source code at run time.....more details... and visit this site for more details...and login there..thtat is simple group of asp experts and u will get prompt reply

 Sample code to freeze column heaing using different methods....

http://www.tctcworld.com/dotnet/viewtopic.php?f=1&t=6

share knowledge..Improve knowledge

happy programming....

 

0
sjk123
7/19/2008 6:17:39 AM

Hi sameer_abhang ,

Live demo:

Lock or Freeze Table Columns plus Non-Scroll Headers

http://web.tampabay.rr.com/bmerkey/examples/locked-column-csv.html

How to do this :

http://blogs.msdn.com/mattdotson/archive/2006/03/02/real-world-gridview-excel-like-frozen-headers-for-asp-net-2-0.aspx

 

 



Samu Zhang
Microsoft Online Community Support

Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
0
Samu
7/21/2008 3:24:40 AM
Reply:

Similar Artilces:

Freezing the column header row of a GridView control using CSS
I am struggling getting my Gridview in ASP.NET 2.0 Visual Studio 2005 to freeze the column header row and provide for scrolling of the remaining data rows. My specific problems right now are: (IE7) column headers freeze as intended and do not scroll  BUT scroll bar is not initially visible to user (requires scrolling with mouse wheel before scroll bars are exposed in gridview) (Firefox 2.0.10) column header row just scrolls out of sight like any other row  Here is part of my default.css in my default App_Theme folder: /* So the overflow scrolls */ div.coveragesContainer ...

Gridview with multiple header rows
Hi, I have just installed the CSS Friendly Control Adapters and now my gridviews are not displaying dynamically added header rows. Code for adding rows is like so: Dim headerCell As New TableHeaderCellheaderCell.ColumnSpan = gridview.Columns.Count headerCell.Text = headingDim rowHeader As New GridViewRow(0, -1, DataControlRowType.Header, DataControlRowState.Normal) rowHeader.Controls.Add(headerCell) CType(gridview.Controls(0), Table).Rows.AddAt(0, rowHeader)   This is typically used for adding a nicely formatted heading row and it is a requirment that i must have this extr...

adding a blank header row /row above the header row
is it possible to add a blank row above the header row in gridview for adding some links and buttons the links will respond to thae data in the grid and the buttons are for login / regisration etc....  if yes how it can be done or how do i achieve it. Its better that u create a table with a single row with columns matching the GridView columns. Set the table width same as the GridView width. This will make the GridView Look as if there is a row above its header.Please do not forget to click Mark As Answer on the post that helped you. Regards,Iam Srikanth Reddy....

Freeze Row Headers in GridView
I'm using Visual Web Developer 2005, and have setup a page using the Gridview that allows sorting on the columns. Is it possible to freeze the row headers to allow for scrolling the database rows, and still keep the headers visible on the page?   Thanks jill I know you can freeze columns so taht they are locked when scrolling horizontally, I just dont know how to freeze row headers.  Please post when you find out. Dear, friend:  Freeze Header:1. Define class .Freezing in Stylesheet: .Freezing {    position:relative ;    top:expressi...

Freeze Header Row on a Gridview
What would be the best way to freeze a header row on a gridview. I'm using V2.0 so i stuck the gridview in a DIV to pickup the scrollbar attribute. So i need the header row to be viewable while scrolling through the table. Well you can refer to this post:  http://forums.asp.net/t/1157564.aspxThanks,Karan~ Remember To Mark The Post(s) That Helped You As The ANSWER ~...

I am able to freeze the header of my gridview, but the header is not scrollable horizontally
As said, I am able to freeze the header of my gridview, but it is not scrollable horizontally with the contents of my table. So finally i got a gridview having a header fixed on the top, but beacause my table has quite a lot of columns, when my gridview scrolls horizontally, the header doesn't move at all, so we can't see which name is for which column in the table, and it doesn't make sense to have a header fixed like that. I am quite sure there should be a simple way to solve the problem.  I don't know how to paste a picture here. It will be more clearly if you...

GridView Freeze Header Works, But Header Border Scrolls Away
I have used the standard CSS style solution to freeze the header in my GridView as shown in the code below.  However, the border around the header does not freeze and I can see the rows scrolling through the thin space where the top edge border used to be when I scroll down the grid.  If I set GridView Border property to 0 then I don't see the rows scrolling through that top edge, but I would like to have a border on the header.  Any suggestions for freezing the border?  I tried setting HeaderStyle-BorderWidth and HeaderStyle-BorderStyle, but no luck there either..hea...

Freeze Column Headers in gridview controls?
Is there a way to freeze the column header row in a gridview control?I am displaying a large table, so the users have to scroll sideways and up and down. I tried to improve this by putting the gridview in a panel, so they can scroll using the panel's scroll buttons and I am able to specify the size of the display. However, if the users scroll down, they loose the name of the columns. Orlando. Here is a way: http://web.tampabay.rr.com/bmerkey/examples/locked-column-csv.htmlSteve Wellens My blog Thank you for that information. It's what I need, but I need to apply this to a gridview, ...

Custom GridView control with button on the header rows
Hi,I am developing a custom control inheriting from GridView.  I want to add a button on each column in the header row.  When the user clicks on the button the particular column should be hidden.  I add the buttons on the prerender of grid view.  Protected Overrides Sub OnPreRender(ByVal e As System.EventArgs)MyBase.OnPreRender(e)Dim tbl As Table = CType(Me.HeaderRow.Parent, Table)If Not tbl Is Nothing ThenFor i As Integer = 0 To Me.HeaderRow.Cells.Count - 1Dim c As Button = New ButtonDim l As Label = New Labell.Text = Me.HeaderRow.Cells(i).Textc.ID = String.Format(H...

How to Freeze the Header of Visual Studio Gridview control
Visual Studio 2005, vb Hi,  I have a web form with gridview control added and would like to know how can I freeze the header row. Thanksptown http://www.codeguru.com/columns/vb/article.php/c14209 Thank you, I will let you know how things turn out.ptown...

handling events of controls in header row of gridview
Hi ,   protected void Button1_Click1(object sender, EventArgs e) { string firstName = string.Empty; string lastName = String.Empty;   // Gets the footer row directly Cool right! GridViewRow row = GridView1.FooterRow; firstName = ((TextBox)row.FindControl("TextBox1")).Text; lastName = ((TextBox)row.FindControl("TextBox2")).Text; Label1.Text = "Data Entered in the Footer Row:" + lastName + " " + firstName; }      above example is useful but suppose ther is dropdownlist in the headerrow of the gridview. how to h...

datagrid with a headers header row
Howdy! I am using a datagrid and I have all the rows and then a header row explaining each column, but I want a row above that as part of the table explaining the table. Thoughts? Cheers Can you explain more clearly what you want? Okay, A normal datagrid has the data fields and the header fields where the header fields are a one to one correlation to the data fields and are used to descibe the data fields. That is perfect as well, but I want to put a title on the datagrid above the header fields to use a couple of words to describe the table itself. There will be s...

Add new controls to a gridview row; when editing that row using the edit row feature in the gridview control.
Hi all  I have a questions that looks hard / complex to me, and i know you can help me in this. Q {  I have row in a Gridview and i have an edit option to it. I press the edit button, to edit the values in that row and update data all the way back to the database. Now when i press the edit button, i want a drop down list to be displayed that contain values for a particular field in my grid view. (for now only plain text boxes appear.) } I hope you understand my question, all i need to do is replace the text box controls with a dropdown list when i am editing a row in ...

Has GridView control improved in VS 2008 especially for freezing column headers?
I am struggling getting my Gridview in ASP.NET 2.0 Visual Studio 2005 to freeze the column header row and provide for scrolling of the remaining data rows. My specific problems right now are:(IE7) column headers freeze and do not scroll  BUT scroll bar is not initially visible to user (requires scrolling with mouse wheel before scroll bars are exposed in gridview)(Firefox 2.0.10) column header row just scrolls out of sight like any other row Does anyone know if ASP.NET 3.5 and VStudio 2008 offer any improvements in this specific area of GridView behavior ? John Hi jjamjatra, Bas...

Web resources about - Freeze Headers(Multiple row headers) in GridView - asp.net.presentation-controls

Code division multiple access - Wikipedia, the free encyclopedia
Code division multiple access ( CDMA ) is a channel access method used by various radio communication technologies. It should not be confused ...

Police officer Daniel Holtzclaw guilty of raping multiple women
For months, accusers, authorities and now an Oklahoma jury say, police officer Daniel Holtzclaw preyed on vulnerable women.

Facebook Tweaks Power Editor for Users With Multiple Ad Accounts
Facebook rolled out a new feature for its Power Editor that should greatly speed up the process for users with multiple advertising accounts. ...

Rockies trade rumors: Carlos Gonzalez could fit on multiple teams
The oft-injured slugger has two years left on his deal. There are three types of teams in the NL West. Subdividing five teams into three categories ...

Google Ventures reportedly closed its European fund after multiple stalled deals
Earlier this week, Google Ventures announced it was closing down its dedicated European fund . It had been assigned $125 million to invest, but ...

OKC Police Officer Found Guilty On Multiple Counts Of Raping Black Women
Former Oklahoma City Police officer Daniel Holtzclaw will be going to prison for a very, very long time. After deliberating for well over 45 ...

Big Pharma bro arrested by federal agents in overnight raid, faces multiple investigations
Big Pharma bro Martin Shkreli gained international notoriety when his company bought the rights to Daraprim—a drug used to treat parasitic infections, ...

Report: Robert Nkemdiche Fell From A 4th-Story Window And Suffered "Multiple Cuts"
Probable top-five NFL draft pick and Ole Miss star Robert Nkemdiche reportedly fell from the 4th floor of a building, and suffered “multiple ...

Google's Chromecast Audio beams music to multiple rooms
If you're been eyeing Google's Chromecast Audio for your holiday shopping spree, Mountain View just added some new features to sweeten the deal. ...

Apple Loop: Multiple iPhone 7 Designs Leak, Tim Cook's $24 Billion NFL Dream, Apple Fights Microsoft
This week’s Apple Loop includes five major design leaks around the iPhone 7, thoughts on the viability of the iPhone 6C, a discussion on 'peak ...

Resources last updated: 12/20/2015 5:46:42 PM