| Author: krishna mohan 13 Jan 2005 | Member Level: Silver Points : 0 |
Use the following style in the head part of the html. but i didn't see that code... plz include that code , i am trying yours logic....
thank you kittu
|
| Author: critic 13 Jan 2005 | Member Level: Bronze Points : 0 |
Please check the article now.. we have updated it so that the style section is visible.
|
| Author: Anand Fadte 04 Feb 2005 | Member Level: Bronze Points : 0 |
I tried using the code, but still doesn't work, can u help me out
|
| Author: Bezawada Kiran Kumar 04 Feb 2005 | Member Level: Silver Points : 0 |
Send me the code. so that i can clarify/.
|
| Author: Bezawada Kiran Kumar 04 Feb 2005 | Member Level: Silver Points : 0 |
Send me the code. so that i can clarify/.And pls explain ur problem in detail.
|
| Author: Hilmar Hilmarsson 08 Feb 2005 | Member Level: Bronze Points : 0 |
Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you ..... I've been looking everywhere for this. Thank you.
|
| Author: LeninGrad 23 Feb 2005 | Member Level: Silver Points : 0 |
This is what i am searching for all these days. Your article is excellent. I do not have any words to explain. I had been searching for this article in various web sites but no clear explanation. Thanks to dotnetspider.com to provide such a nice article.
Great applause to this guy
|
| Author: Sue oates 27 Feb 2005 | Member Level: Bronze Points : 0 |
Hi, I have been searching for code to implement a fixed header datagrid.
I have attempted to implement the code provided for Freezing Headers of the DataGrid in ASP.NET in VB code.
I have made the following changes to your method Datagrid1_ItemDataBound:
Private Sub dgBasins_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgBasins.ItemDataBound Select Case e.Item.ItemType Case ListItemType.Header Dim i As Integer For i = 0 To e.Item.Cells.Count - 1 e.Item.Cells(i).CssClass = "lockrow" Next
End Select End Sub
When I run this, the page header style certainly changes with green background and white font. However, the header still scrolls off the top of the div-datagrid.
I was under the understanding that the header did not scroll. Is this correct, and if so can you highlight the error in my code.
Thanks in anticipation of your help.
|
| Author: surya phani 03 Mar 2005 | Member Level: Bronze Points : 0 |
Hey buddy, it works, Thanks a lot. I used to set a HTML table above the grid earlier instead of using the header. Thanks to u.
|
| Author: Jagadish Dandin 08 Sep 2005 | Member Level: Bronze Points : 0 |
Everything is fine. But the columns in the headers cannot be differentiated. The lines that differentiate different columns disappear when this style is applied to header.
Any solution for this would be appreciated.
Thanks in advance.
|
| Author: Jagadish Dandin 08 Sep 2005 | Member Level: Bronze Points : 0 |
Hi I figured out the problem. the solution suggested above works perfectly.
if we try to apply the style on the client side in the the column lines will not be visible. If we apply the style as suggested
switch(e.Item.ItemType) { case ListItemType.Header: for(i=0;i<=e.Item.Cells.Count-1;i++) { e.Item.Cells[i].CssClass="lockrow"; } break; }
it works perfectly.
regards Jagadish
|
| Author: Jagadish Dandin 08 Sep 2005 | Member Level: Bronze Points : 0 |
Hi I figured out the problem. if we try to apply the style on the client side in the header style
the column lines will not be visible. If we apply the style as suggested in the article
switch(e.Item.ItemType) { case ListItemType.Header: for(i=0;i<=e.Item.Cells.Count-1;i++) { e.Item.Cells[i].CssClass="lockrow"; } break; }
it works perfectly.
|
| Author: HDave 13 Dec 2005 | Member Level: Bronze Points : 0 |
Nice!! Excellent solution!!
|
| Author: HDave 13 Dec 2005 | Member Level: Bronze Points : 0 |
//============= Grid.CSS ================ BODY { } .Grid { BACKGROUND-COLOR: WhiteSmoke; BORDER: #1F4597 1px solid; FONT-SIZE: 12px; FONT-FAMILY: Tahoma; COLOR: Black; }
.Grid td { BORDER: #1F4597 1px solid; PADDING: 3px; }
.GridColHeader { BACKGROUND-COLOR: #1F4597; FONT-SIZE: 12px; FONT-FAMILY: Tahoma; FONT-WEIGHT: bold; COLOR: White; TEXT-TRANSFORM: capitalize; }
.GridColFooter { BACKGROUND-COLOR: #CCCCCC; }
.GridItem { BACKGROUND-COLOR: Transparent; FONT-SIZE: 12px; FONT-FAMILY: Tahoma; COLOR: Black; }
.GridAltItem { BACKGROUND-COLOR: Ivory; FONT-SIZE: 12px; FONT-FAMILY: Tahoma; COLOR: Black; }
DIV#div-datagrid { OVERFLOW: auto; WIDTH: 100%; HEIGHT: 200px } .LockRow { TOP: expression(document.getElementById("div-datagrid").scrollTop-2); POSITION: relative; }
//============= Grid.CSS ================
//============= ASPX ==================
//DataGrid //============= ASPX ================== // |
| Author: HDave 13 Dec 2005 | Member Level: Bronze Points : 0 |
//============= Grid.CSS ================ BODY { } .Grid { BACKGROUND-COLOR: WhiteSmoke; BORDER: #1F4597 1px solid; FONT-SIZE: 12px; FONT-FAMILY: Tahoma; COLOR: Black; }
.Grid td { BORDER: #1F4597 1px solid; PADDING: 3px; }
.GridColHeader { BACKGROUND-COLOR: #1F4597; FONT-SIZE: 12px; FONT-FAMILY: Tahoma; FONT-WEIGHT: bold; COLOR: White; TEXT-TRANSFORM: capitalize; }
.GridColFooter { BACKGROUND-COLOR: #CCCCCC; }
.GridItem { BACKGROUND-COLOR: Transparent; FONT-SIZE: 12px; FONT-FAMILY: Tahoma; COLOR: Black; }
.GridAltItem { BACKGROUND-COLOR: Ivory; FONT-SIZE: 12px; FONT-FAMILY: Tahoma; COLOR: Black; }
DIV#div-datagrid { OVERFLOW: auto; WIDTH: 100%; HEIGHT: 200px } .LockRow { TOP: expression(document.getElementById("div-datagrid").scrollTop-2); POSITION: relative; }
//============= Grid.CSS ================
//============= ASPX ==================
//DataGrid //============= ASPX ================== // |
| Author: HDave 13 Dec 2005 | Member Level: Bronze Points : 0 |
//==============ASPX=================
//==============ASPX=================
|
| Author: HDave 13 Dec 2005 | Member Level: Bronze Points : 0 |
//
|
| Author: HDave 13 Dec 2005 | Member Level: Bronze Points : 0 |
//div id=div-datagrid { OVERFLOW: auto; WIDTH: "100%"; HEIGHT: 400px > //asp:datagrid id="dgBatchLog" runat="server" Width="100%" CssClass="Grid"> // // // // ///asp:datagrid> ///div>
|
| Author: HDave 13 Dec 2005 | Member Level: Bronze Points : 0 |
Note: replace "// with "<"
//div id=div-datagrid { OVERFLOW: auto; WIDTH: "100%"; HEIGHT: 400px > //asp:datagrid id="dgBatchLog" runat="server" Width="100%" CssClass="Grid"> //FooterStyle CssClass="GridColFooter"> //AlternatingItemStyle CssClass="GridAltItem"> //ItemStyle CssClass="GridItem"> //HeaderStyle CssClass="GridColHeader"> ///asp:datagrid> ///div>
|
| Author: Sirisha Akella 02 Feb 2006 | Member Level: Bronze Points : 0 |
But I still do have a problem. Actually, I have a datagrid with a template column with dropdown and other bound columns. Rest of the columns are working fine, but with this particular template column, the dropdown is scolling over the corresponding header text. Please help
|
| Author: Bernie Miller 14 Mar 2007 | Member Level: Bronze Points : 0 |
When applied to a multi-line header, headings that span multiple rows are chopped off so you only see the top half of the text. Any ideas on how to correct this? Thanks.
|
| Author: Bernie Miller 15 Mar 2007 | Member Level: Bronze Points : 0 |
Hello, when combined with the multi-line header solution at http://www.codeproject.com/aspnet/MergeDatagridHeader.asp the second row of a rowspan=2 heading is always blank. If I move the text to the first row it appears fine. Centered in the middle and half the text is gone. Moved to the bottom row and it completely disappears. It's not a huge issue but I would prefer the heading to be centered or on the bottom row. Any ideas why this is happening? Thanks.
|
| Author: Bernie Miller 21 Mar 2007 | Member Level: Bronze Points : 0 |
Hello, all CSS solutions seem to have the same issue. You cannot center the table. If you do the header will no longer align with the data when the page is re-sized. I have yet to come across a solution to this limitation.
|
| Author: Rajkumar 01 Aug 2007 | Member Level: Silver Points : 0 |
Hi,
I tried with your piece of code.. It worked well.. Its very simple and very useful..Thanks..
By, P.T.RAJKUMAR
|