 |
|
 |
How? I've already implemented this and it works fine, but I'm having trouble altering the color of the Visited Link in Just the Header only.
smcirish
|
|
|
|
 |
|
 |
Use CSS dude. Set a class to the links and define the color using CSS.
|
|
|
|
 |
|
 |
Hi all....
I am using asp.net 2.0 GridView and implemented scroll bars
I want the gridview header fixed to be ,when scrolled vertically..
I have this code, but it is not working
<style type="text/css">
<!--
.DataGridFixedHeader {background-color: white; position:relative; top:expression(this.offsetParent.scrollTop);}
-->
</style>
<asp:datagrid id="dgContacts" runat="server" ...="">
...
<headerstyle cssclass="ms-formlabel DataGridFixedHeader"></headerstyle>
Please Help out
Thanks
Aswini
|
|
|
|
 |
|
 |
the border to head datagrid not see:
.DataGridFixedHeader { POSITION: relative; border:1px solid #DEBA84; TOP: expression(this.offsetParent.scrollTop); font-family: Arial, sans-serif; font-size:12px;}
border:1px solid #DEBA84;
necesito que se vea el borde por favor si alguien me ayuda...help mee pliss!!
Roxana
|
|
|
|
 |
|
 |
I'm having this same problem.
Actually, I found that I had to use TOP:expression(this.offsetParent.scrollTop-2) or when I scrolled down on the page I could see 2 pixels of the grid scrolling past above the header. But that's a different problem.
The problem I have now is that the grid lines between the header columns are gone. Any ideas?
|
|
|
|
 |
|
 |
does anyone found solution for this?
|
|
|
|
 |
|
 |
I am also having the same problem. Cant see the vertical lines in the header row
|
|
|
|
 |
|
|
 |
|
 |
Tried this and now the header text insists on being centered - can't seem to get it left aligned and the background color is also not applied - may be other issues.
|
|
|
|
 |
|
 |
I switched to the html view of the aspx page and checked the code for the datagrid.
I have
<HeaderStyle Font-Size="X-Small" Font-Names="Arial" Font-Bold="True" Wrap="False" HorizontalAlign="Left"
ForeColor="White" CssClass="DataGridFixedHeader" BackColor="#7010AB"></HeaderStyle>
for the datagrid. I was able to get it to left align and change the background colour of the header by
adjusting the HorizontalAlign and BackColor attributes, as above.
Maybe something is overriding your datagrid header style? I just remember being frustrated with the
'visual' way of editing datagrids, in the end I found it easier to go straight to the html, once I had
created the basic structure (which actually I would have done visually)
Cheers
|
|
|
|
 |
|
 |
hi,
i have used both div and Fixed header in my page and div has both the scroll bars and the headers are not fixed inside the DIV when the grid has more columns.
is there any way we can do this.
|
|
|
|
 |
|
 |
<DIV style="OVERFLOW: auto; HEIGHT: 120px"> <asp:DataGrid ... </DIV> ============================================== Can the above be altered so I get just a vertical scroll, an surpress the Horizontal scroll? -smc
|
|
|
|
 |
|
 |
Try with:
<div style="OVERFLOW-Y: scroll; WIDTH: 780px; HEIGHT: 500px;">
It worked for me... I hope it will work for you.
Horacio.
|
|
|
|
 |
|
 |
the following code worked fine with me (you will not find it in other sites cause i maintained it my self, and just putted it here):
put the following in the "default.skin" - or whatever default skin of your site<asp:GridView runat="server">
<HeaderStyle CssClass="FixedHeader" />
< PagerStyle CssClass="FixedFooter" />
</asp:GridView>
and put the following in the "Styles.css" - or whatever default style of your site
TR.FixedHeader TH
{
position:relative;
top: expression(this.parentNode.parentNode.parentNode.offsetParent.scrollTop);
}
TR.FixedFooter TD
{
position:relative;
bottom: expression((this.parentNode.parentNode.parentNode.offsetParent.scrollHeight <= this.parentNode.parentNode.parentNode.offsetParent.clientHeight)?0:this.parentNode.parentNode.parentNode.offsetParent.scrollHeight - this.parentNode.parentNode.parentNode.offsetParent.clientHeight - this.parentNode.parentNode.parentNode.offsetParent.scrollTop);
}
you may edit the "this.parentNode.parentNode.parentNode.offsetParent" blocks to be "this.parentNode.parentNode.offsetParent" to refer to the parent DIV you assigned its "overflow" style to be auto/scroll.
AhmedElbatal
|
|
|
|
 |
|
 |
Hi all
expression do not work in mozilla.how can i fix the |
|
|
|
|
 |
|
 |
This works great, but I've encountered one problem with this method. When I scroll down below the end of the visible area and edit an item, I have to call Focus() on that item to keep the DataGrid from scrolling back to the top. When I focus on the item, the DataGrid is rendered with the header either above the DataGrid or a lot of the times, off of the page entirely.
Thanks for your help,
Evan
|
|
|
|
 |
|
 |
An example of the problem is below with the employee info removed:
Initial state of page after scrolling to an employee to edit:
http://www.comfx.com/v.php?d=715994
State of page after clicking the edit button:
http://www.comfx.com/v.php?d=894356
Hope the images help to clarify the issue.
|
|
|
|
 |
|
 |
I am having this same problem. I have a checkbox for each row and when you check it, it will change the style.display of one of the row items. It will only happen if you have scrolled down on the datagrid and check one of the items down there.
I think it is mistakening where the top position should be whenever you change something in the datagrid.
Did you ever find out how to fix it?
|
|
|
|
 |
|
 |
especially not with "this," you can just put the grid in an asp:label and in the header class put
position:relative;
top: -2px;
On some browsers, resizing will display it wrong until hitting refresh.
|
|
|
|
 |
|
 |
I faced similar problem ... header in my gridview vanished after i resized.
i added position:absolute to parent div's style ... and it works fine now
|
|
|
|
 |
|
 |
This is a great tip. Too bad MSFT didn't see fit to provide a property for the DNF 2.x gridview control to control the headers.
I found one thing that can easily break this tip. If you happen to move controls around on the form you MIGHT end up with an position:absolute tag in the <asp:Gridview... /> definition. Just remove it and non-scrolling headers will return.
Regards,
John Saxton
MCAD, Security+
|
|
|
|
 |
|
 |
Hi all...
I build a datagrid by code , It succeed, but how can change columns names ?
Thanx
Nour
|
|
|
|
 |
|
 |
On datagrid, use method item_data_bound Ex: Datagrid2_ItemDataBound Put code similar to below in the method. The code below has options to hid columns, and rename columns. Private Sub Datagrid2_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles Datagrid2.ItemDataBound ' =================== Item Columns =========================== If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then 'Columns to Hide 'Hide these cell Columns e.Item.Cells(0).Visible = False 'Hide items in COL 0
End If 'end of If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem
' =================== Header Columns =========================== 'Need to hide header for column j If e.Item.ItemType = ListItemType.Header Then 'Hide these Header Columns e.Item.Cells(0).Visible = False 'Hide items in COL 0 'Column Names e.Item.Cells(1).Text = "Index" e.Item.Cells(2).Text = "Year" e.Item.Cells(3).Text = "Name" e.Item.Cells(4).Text = "Address" End If 'end of If e.Item.ItemType = ListItemType.Header test End Sub 'Datagrid2_ItemDataBound -smc
|
|
|
|
 |
|
 |
Hi
I have a templatedColumn in my gridview.in thisfield i insert a asp:checkbox
<asp:gridview ...>
<asp:checkbox..........
i want to track in code behind which row is checked.
|
|
|
|
 |
|
 |
hi all
i try the following coode to implement fixed header scrollable gridview after the databind server side method.
foreach(TableCell cell in this.header.cell)
{
cell.styles.add("pasition","relative");
}
but i ot a problem that it does noot work in all browser except IE.
plz help me to solve this problem.
Ronjon
email: ronjon0171@yahoo.com
|
|
|
|
 |