GridView : Freezing First Columns and Freezing Column's Headers

Hi

Looking for code that freezes the first two columns and the column's headers in a GridView, so as to give a similar behavior and the appearance of Excel, but in Visual Web Developer, I've found a link that show a very efficient solution, but applies just to a DataGrid control in IE. I've found lots of additional information in the web, but I think the best aproach is this...

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

http://www.codeproject.com/aspnet/FreezePaneDatagrid.asp

Please, look at this alternative solution also... may be useful!

http://www.codeproject.com/useritems/FreezeHeader.asp

I'd appreciate if someone can send me a code example to help me apply this solution to a GridView instead of a DataGrid. I've tried to find the way to do it, but here I'm, asking for some advice.

Thank you very much! 

Max

 

0
mjohnen
6/9/2007 3:49:03 PM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

8 Replies
1789 Views

Similar Articles

[PageSpeed] 24

Hi Max,

It is similar in GridView. Please try below 2 steps:

1   Add locked Css:

 td.locked, th.locked {
position:relative;   
left:expression((this.parentElement.parentElement.parentElement.parentElement.scrollLeft-2)+'px');
}   


 2   In RowDataBound event add css to GridView cell:

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            e.Row.Cells[0].CssClass = "locked";
        }
    }

Please feel free to let us know if you need more assistance.Thanks.


NOTE:If you find my response contains a reference to a third party World Wide Web site, I am providing this information as a convenience to you.Microsoft does not control these sites and has not tested any software or information found on these sites; therefore,Microsoft cannot make any representations regarding the quality,safety, or suitability of any software or information found there.
__________________________________________________

Sincerely,
Young Fang
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. This can be beneficial to other community members reading the thread.
0
Young
6/12/2007 4:05:32 AM

Hi:

  Just try this:

 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        e.Row.Cells[0].CssClass = "locked";
        e.Row.Cells[1].CssClass = "locked";
    }

  <head runat="server">
    <title>Untitled Page</title>
    <style type="text/css">

div#div-datagrid {
width: 220px;
height: 100px;
overflow: auto;
scrollbar-base-color:#ffeaff;
}

/* Locks the left column */
td.locked, th.locked {
font-size: 14px;
font-weight: bold;
text-align: center;
background-color: navy;
color: white;
border-right: 1px solid silver;
position:relative;
cursor: default;
/*IE5+ only*/
left: expression(document.getElementById("div-datagrid").scrollLeft-2);
}

/* Locks table header */
th {
font-size: 14px;
font-weight: bold;
text-align: center;
background-color: navy;
color: white;
border-right: 1px solid silver;
position:relative;
cursor: default;
/*IE5+ only*/
top: expression(document.getElementById("div-datagrid").scrollTop-2);
z-index: 10;
}

/* Keeps the header as the top most item. Important for top left item*/
th.locked {z-index: 99;}

/* DataGrid Item and AlternatingItem Style*/
.GridRow {font-size: 10pt; color: black; font-family: Arial;
             background-color:#ffffff; height:35px;}
.GridAltRow {font-size: 10pt; color: black; font-family: Arial;
             background-color:#eeeeee; height:35px;}
</style>
</head>

 

 

 

 <div id="div-datagrid">
        <asp:GridView DataSourceID="SqlDataSource1" ID="GridView1" runat="server" OnRowCreated="GridView1_RowCreated" OnRowDataBound="GridView1_RowDataBound">
        </asp:GridView> </div>

If it doesn't work, please inform us.

Regards


Sincerely,
Allen Chen
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
0
Allen
6/12/2007 7:23:01 AM

I'll try this code and see what happens.

Thank you very much for your advices!!

Max

0
mjohnen
6/15/2007 4:28:18 PM

Hi Allen:

Sorry I'm bothering you again, but your advices worked fine and your code were very useful, without doubt.

Your code's working well in my Gridview. The header get freezed for vertical scrolling and the two first Columns get also frrezed to horizontal scrolling.

That's nice!

But there's still a problem.

I can't get the header freezed to horizontal scrolling. Please look at my code (attatched).

I'd appreciate if you find out what I'm doing wrong.

For my project functionality, I need the header to be freezed at horizontal scrolling.

I really appreciate your help!

Thanks a lot!

I'll be in touch!

Regards, Max

1) This is the Stylesheet (Css): 

/* Div container to wrap the datagrid */

div#div-datagrid {

width: 420px;

height: 200px;

overflow: auto;

scrollbar-base-color:#ffeaff;

}

/* Locks the left column */

td.locked, th.locked {

font-size: 7pt;

text-align: left;

background-color:inherit;

color:Black;

position:relative;

cursor: default;

left: expression(document.getElementById("div-datagrid").scrollLeft-2); /*IE5+ only*/

}

/* Locks table header */

th {

font-size: 7pt;

font-weight: bold;

text-align: center;

background-color: navy;

color: white;

height:15pt;

border-right: 1px solid silver;

position:relative;

cursor: default;

top: expression(document.getElementById("div-datagrid").scrollTop-2); /*IE5+ only*/

z-index: 10;

}

/* Keeps the header as the top most item. Important for top left item*/

th.locked {z-index: 99;}

 

/* DataGrid Item and AlternatingItem Style*/

.GridRow {font-size: 7pt; color: black; font-family: Verdana; background-color:#ffffff; height:15px;}

.GridAltRow {font-size: 7pt; color: black; font-family: Verdana; background-color:#eeeeee; height:15px;}

 

 2) This is the Html Code... 

<%@ Page Language="VB" MasterPageFile="~/M00.master" AutoEventWireup="false" CodeFile="Page00.aspx.vb" Inherits="Page00" title="Untitled Page" %>

<%@ Register Assembly="Controls" Namespace="Tittle.Controls" TagPrefix="Tittle" %>

<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

Namespace="System.Web.UI" TagPrefix="asp" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<div style="z-index: 101; left: 11px; width: 930px; position: absolute; top: 52px;

height: 560px; border-right: #cccccc thin ridge; border-top: #cccccc thin ridge; background-image: url(App_GlobalResources/FondoCircuito.gif); border-left: #cccccc thin ridge; border-bottom: #cccccc thin ridge; background-repeat: repeat; background-attachment: fixed;">

<span style="font-size: 12pt">

<asp:Label ID="PaginacionLabel" runat="server" CssClass="rotulos" Style="z-index: 100;

left: 368px; position: absolute; top: 5px" Text="Paginaci¢n General" Width="194px"></asp:Label>

</span>

 

<asp:TextBox ID="SearchKey0" runat="server" CssClass="campos" Style="z-index: 101;

left: 162px; position: absolute; top: 43px" Width="110px" TabIndex="2"></asp:TextBox>

<asp:TextBox ID="SearchKey1" runat="server" Style="z-index: 102; left: 21px; position: absolute;

top: 43px" TabIndex="1" Width="132px"></asp:TextBox>

<asp:Button ID="SearchButton" runat="server" CssClass="botones" Style="z-index: 103;

left: 283px; position: absolute; top: 42px" Text="Buscar" Width="70px" Height="24px" TabIndex="3" />

<asp:DropDownList ID="RowDeploy" runat="server" Style="z-index: 104; left: 551px;

position: absolute; top: 43px" CssClass="campos" TabIndex="12" Width="53px" AutoPostBack="True">

<asp:ListItem>20</asp:ListItem>

<asp:ListItem>50</asp:ListItem>

<asp:ListItem>100</asp:ListItem>

<asp:ListItem>200</asp:ListItem>

<asp:ListItem>500</asp:ListItem>

<asp:ListItem>1000</asp:ListItem>

</asp:DropDownList>

<asp:Label ID="RowsLabel" runat="server" Style="z-index: 105; left: 515px; position: absolute;

top: 46px" Text="Filas?" Width="48px" CssClass="prompt"></asp:Label>

&nbsp; &nbsp; &nbsp;

&nbsp; &nbsp;

&nbsp; &nbsp;

<asp:Button ID="firstButton" runat="server" CssClass="botones" Style="z-index: 106;

left: 374px; position: absolute; top: 44px" Text="<<" Width="35px" TabIndex="4" Font-Bold="True" ForeColor="#000033" />

<asp:Button ID="prevButton" runat="server" CssClass="botones" Style="z-index: 107;

left: 413px; position: absolute; top: 44px" Text="<" Width="22px" TabIndex="5" Font-Bold="True" ForeColor="#000033" />

<asp:Button ID="nextButton" runat="server" CssClass="botones" Style="z-index: 108;

left: 439px; position: absolute; top: 44px" Text=">" Width="21px" TabIndex="6" Font-Bold="True" ForeColor="#000033" />

<asp:Button ID="lastButton" runat="server" CssClass="botones" Style="z-index: 109;

left: 464px; position: absolute; top: 44px" Text=">>" Width="35px" TabIndex="7" Font-Bold="True" ForeColor="#000033" />

&nbsp;&nbsp;

<asp:Button ID="ExcellButton" runat="server" CssClass="botones" Style="z-index: 110;

left: 818px; position: absolute; top: 44px" Text="Excel" Width="61px" />

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />

<br />

<asp:Button ID="Button1" runat="server" Style="z-index: 111; left: 607px; position: absolute;

top: 44px" Text="F" Width="30px" Height="21px" />

&nbsp;&nbsp;&nbsp;<br />

<asp:Label ID="LabelMensajes" runat="server" Font-Bold="True" Font-Names="verdanaa"

Font-Size="X-Small" ForeColor="Red" Style="z-index: 112; left: 26px; position: absolute;

top: 27px"></asp:Label>

&nbsp;&nbsp;<br />

<br />

<br />

<br />

<br />

<div id="div-datagrid" style="z-index: 115; left: 22px; width: 478px; position: absolute; top: 72px; height: 380px; " class="panel">

<asp:GridView ID="GridContactos" runat="server" AutoGenerateColumns=False style="z-index: 100; left: 2px; position: absolute; top: 2px" Font-Bold="False" Font-Italic="False" Font-Names="Verdana" Font-Overline="False" Font-Strikeout="False" Font-Underline="False" Width="634px" Height="219px" GridLines="None" DataKeyNames="ContactID" TabIndex="2">

<AlternatingRowStyle CssClass="GridAltRow" Wrap="False"></AlternatingRowStyle>

<RowStyle CssClass="GridRow" Wrap="False"></RowStyle>

<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="False" />

<FooterStyle Wrap="False" />

<PagerStyle Wrap="False" />

<Columns>

<asp:CommandField SelectText="S" ShowSelectButton="True" />

<asp:BoundField DataField="LastName" HeaderText="LastName" SortExpression="LastName" />

<asp:BoundField DataField="ContactID" HeaderText="ContactID" InsertVisible="False"

ReadOnly="True" SortExpression="ContactID" />

<asp:BoundField DataField="FirstName" HeaderText="FirstName" SortExpression="FirstName" />

<asp:BoundField DataField="EmailAddress" HeaderText="EmailAddress" SortExpression="EmailAddress" />

<asp:BoundField DataField="Phone" HeaderText="Phone" SortExpression="Phone" />

</Columns>

</asp:GridView>

&nbsp; &nbsp;

</div>

<div id="DetalisView">

<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" BackColor="White"

BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" CellPadding="3" CellSpacing="1"

DataKeyNames="ContactID" DataSourceID="SqlDataSource1" GridLines="None" HeaderText="Detalle de Contacto"

Height="379px" Style="z-index: 114; left: 511px; position: absolute; top: 71px"

Width="366px" TabIndex="1">

<FooterStyle BackColor="#00C0C0" Font-Bold="True" ForeColor="Black" Font-Size="Small" />

<EditRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />

<RowStyle BackColor="#DEDFDE" ForeColor="Black" />

<PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />

<Fields>

<asp:BoundField DataField="ContactID" HeaderText="ContactID" InsertVisible="False"

ReadOnly="True" SortExpression="ContactID" />

<asp:BoundField DataField="LastName" HeaderText="LastName" SortExpression="LastName" />

<asp:BoundField DataField="FirstName" HeaderText="FirstName" SortExpression="FirstName" />

<asp:CheckBoxField DataField="NameStyle" HeaderText="NameStyle" SortExpression="NameStyle" />

<asp:BoundField DataField="EmailAddress" HeaderText="EmailAddress" SortExpression="EmailAddress" />

<asp:BoundField DataField="Phone" HeaderText="Phone" SortExpression="Phone" />

<asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />

<asp:BoundField DataField="MiddleName" HeaderText="MiddleName" SortExpression="MiddleName" />

<asp:BoundField DataField="Suffix" HeaderText="Suffix" SortExpression="Suffix" />

<asp:BoundField DataField="EmailPromotion" HeaderText="EmailPromotion" SortExpression="EmailPromotion" />

<asp:BoundField DataField="ModifiedDate" HeaderText="ModifiedDate" SortExpression="ModifiedDate" />

<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowInsertButton="True" />

</Fields>

<HeaderStyle BackColor="Navy" Font-Bold="True" ForeColor="White" HorizontalAlign="Center" Height="8px" />

</asp:DetailsView>

</div>

<asp:SqlDataSource ID="SqlDataSource1" runat="server"

ConnectionString="<%$ ConnectionStrings:ContactosConnectionString %>" DeleteCommand="DELETE FROM [Contactos] WHERE [ContactID] = @original_ContactID"

InsertCommand="INSERT INTO [Contactos] ([NameStyle], [Title], [FirstName], [MiddleName], [LastName], [Suffix], [EmailAddress], [EmailPromotion], [Phone], [ModifiedDate]) VALUES (@NameStyle, @Title, @FirstName, @MiddleName, @LastName, @Suffix, @EmailAddress, @EmailPromotion, @Phone, @ModifiedDate)"

OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT * FROM [Contactos] WHERE ([ContactID] = @ContactID)"

UpdateCommand="UPDATE [Contactos] SET [NameStyle] = @NameStyle, [Title] = @Title, [FirstName] = @FirstName, [MiddleName] = @MiddleName, [LastName] = @LastName, [Suffix] = @Suffix, [EmailAddress] = @EmailAddress, [EmailPromotion] = @EmailPromotion, [Phone] = @Phone, [ModifiedDate] = @ModifiedDate WHERE [ContactID] = @original_ContactID">

<DeleteParameters>

<asp:Parameter Name="original_ContactID" Type="Int32" />

</DeleteParameters>

<UpdateParameters>

<asp:Parameter Name="NameStyle" Type="Boolean" />

<asp:Parameter Name="Title" Type="String" />

<asp:Parameter Name="FirstName" Type="String" />

<asp:Parameter Name="MiddleName" Type="String" />

<asp:Parameter Name="LastName" Type="String" />

<asp:Parameter Name="Suffix" Type="String" />

<asp:Parameter Name="EmailAddress" Type="String" />

<asp:Parameter Name="EmailPromotion" Type="Int32" />

<asp:Parameter Name="Phone" Type="String" />

<asp:Parameter Name="ModifiedDate" Type="DateTime" />

<asp:Parameter Name="original_ContactID" Type="Int32" />

</UpdateParameters>

<InsertParameters>

<asp:Parameter Name="NameStyle" Type="Boolean" />

<asp:Parameter Name="Title" Type="String" />

<asp:Parameter Name="FirstName" Type="String" />

<asp:Parameter Name="MiddleName" Type="String" />

<asp:Parameter Name="LastName" Type="String" />

<asp:Parameter Name="Suffix" Type="String" />

<asp:Parameter Name="EmailAddress" Type="String" />

<asp:Parameter Name="EmailPromotion" Type="Int32" />

<asp:Parameter Name="Phone" Type="String" />

<asp:Parameter Name="ModifiedDate" Type="DateTime" />

</InsertParameters>

<SelectParameters>

<asp:SessionParameter Name="ContactID" SessionField="ContactID" Type="Int32" />

</SelectParameters>

</asp:SqlDataSource>

&nbsp;<br />

</div>

<asp:Label ID="TopLastName" runat="server" Style="z-index: 101; left: 44px; position: absolute;

top: 707px" Visible="False"></asp:Label>

<br />

<asp:Label ID="TopContactID" runat="server" Style="z-index: 100; left: 436px; position: absolute;

top: 706px" Visible="False"></asp:Label>

<br />

<asp:Label ID="BottomLastName" runat="server" Style="z-index: 102; left: 136px; position: absolute;

top: 707px" Visible="False"></asp:Label>

<br />

<asp:Label ID="BottomContactID" runat="server" Style="z-index: 104; left: 249px; position: absolute;

top: 709px" Visible="False"></asp:Label>

<br />

<asp:Label ID="UpdateKEY" runat="server" Style="z-index: 114; left: 361px; position: absolute;

top: 708px" Visible="False"></asp:Label>

</asp:Content>

 

3) This is my VBScript Event handling code... 

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

Freeze()

End Sub

Sub Freeze()

Dim Locked As Integer = Session("Locked")

Dim I As Integer = 0

Dim J As Integer = Session("Filas")

Select Case Locked

Case 0

If J <= 100 Then

For I = 0 To J - 1

GridContactos.HeaderStyle.CssClass = "locked"

GridContactos.Rows(I).Cells(0).CssClass = "locked"

GridContactos.Rows(I).Cells(1).CssClass = "locked"

GridContactos.Rows(I).Cells(2).CssClass = "locked"

Next

Session("Locked") = 1

LabelMensajes.Text = "Primeras dos columnas est n Fijas..."

Else

LabelMensajes.Text = "No 'congelar' columnas si pagina tiene m s de 100 filas... ­Gracias!"

End If

Case 1

For I = 0 To J - 1

GridContactos.HeaderStyle.CssClass = "Unlocked"

GridContactos.Rows(I).Cells(0).CssClass = "Unlocked"

GridContactos.Rows(I).Cells(1).CssClass = "Unlocked"

GridContactos.Rows(I).Cells(2).CssClass = "Unlocked"

Next

Session("Locked") = 0

LabelMensajes.Text = ""

End Select

End Sub

 

0
mjohnen
6/15/2007 5:20:48 PM

Hi:

  We can add this bold one to freeze the left of the th:

th {
font-size: 14px;
font-weight: bold;
text-align: center;
background-color: navy;
color: white;
border-right: 1px solid silver;
position:relative;
cursor: default;
/*IE5+ only*/
left: expression(document.getElementById("div-datagrid").scrollLeft-2);
top: expression(document.getElementById("div-datagrid").scrollTop-2);
z-index: 10;
}

If it doesn't work, please inform us.


Regards


Sincerely,
Allen Chen
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
0
Allen
6/18/2007 7:30:00 AM

I came up with a very simple solution using stylesheet. You can check it out on following link.

http://www.vishwamohan.com/ShowArticle.aspx?ArticleID=37

 


Vishwa


My Web Site and Blog
0
vishwa
8/4/2007 4:49:12 AM

Hi there, I was searching for a solution of the freezing columns in gridview and I so this, the code works fine, the one in the codeproject page, but i have a problem, when i have alot of that it gets so slow,

and its almost imposible to move the scroll fast because the hole page gets freeze, so anybody has a better solution?? thanks

0
wooper
10/20/2008 11:12:24 PM

Hi allen, just read and implemented this solution you wrote however it works great..but the frozen panes are outside the table i have my gridview in (gridview added to panel to gain access to scroll bars).

Basically, the data thats not frozen sits inside the panel but the frozen panes don't abide by the panel..

Can you assist?

0
zell71
4/14/2009 10:47:09 AM
Reply:

Similar Artilces:

how to freeze the datagrid header and how to freeze the datagrid first column
please tell me in detail how could i freeze datagrid header and datagrid first column. as a result when user scroll upward or downward then then datagrid header will be fixed.please help me with source code. Hi, I already gave the answer here: view post 624500. Grz, Kris.Read my blog. Handy Firefox plugins for web developers.Workaround for non working Mark as answer buttons....

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, ...

How to freeze gridview header and first column while scrolling
Hi Friends, I am having one gridview inside panel.  My asp.net design source code using c# is like this, "<asp:Panel ID="myPanel" runat="server" ScrollBars="Both" Height="200px" Width="300px">        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"        PageSize="5" OnPageIndexChanging="GridView1_PageIndexChanging" AllowPaging="True" > ...

Gridview
Gridview - how to find a column by it's column name rather than it's Cell index Hello Friendshow to find a column by it's column name rather than it's Cell indexi.e i want to do something likestrFirstName = Grid1.Rows[2].Cells["FirstName"]In the project i am working on gets customized to different customers....so the position of the columns keep changing depending on the customers requirement.hardcoding..like below is a pain to maintainif i use Grid1.Rows[2].Cells["1"]Can some body help..regardsSara Hi, columns do not get associated names exactly like that. Nearest equivalent w...

Replace 1's and 0's in a gridview column with Yes's and No's
Is it possible to change the display of a column in a gridview to show a Yes for all 1's and a No for 0's that display in a particular column of a gridview bound to a database?  If so, can someone share the way with me?  I am using ASP.NET 2.0 with VB Code Behind.  Thanks One way you can do is thrrough  CASE in your select statement: Select YesNoColumn= CASE yourColumn WHEN 1 THEN 'Yes' WHEN 0 THEN 'No' ELSE '' END FROM YourtableLimno <Columns>     <asp:TemplateField HeaderText="yourHeader" SortExpression="yourDataField"> ...

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 ...

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...

I need all possible ways to freeze Gridview first Column and header based on performance on cpu....
My requirement is to freeze the Column and header of Grid view I searched a lot on internet to get the possible ways One best method i found is by using CSS http://forums.asp.net/t/1120278.aspx this link has the best way but when performing with large tables it is becoming very slow and cpu performation is low...Please give me new any advices or any new methods...with better performance Hi hivenkat  , <div style="height:200px;overflow:auto; width: 200px;">        <asp:GridView ID="GridView1" runat="...

freezing the first column of a gridview
Is there a way to freeze a gridview col ?? If i understand your problem correctly then..   use readonly property to true for that particular column... and don't derine edittemplatemethod.. Mark Reply As ANSWER IF IT HELPS YOU.If this has helped Please: Don't forget to click "Mark as Answer" on the post that helped you.That way future readers will know which post solved your issue. I need my gridview to act like how an excel spread sheet works when you freez a col see this link............ http://www.codeproject.com/aspnet/FreezePaneDatagrid.asp  or...

How to Freeze a gridview header and columns
  Hi Friends, In ASP.Net web application using c#,Iam having one Gridview control inside the panel. How to freeze a gridview header and columns when the gridview control has both horizontal and vertical scrollbars?  Hi Vinoce.Very suitable example for your requirement.http://www.codeproject.com/KB/aspnet/AntonioSuarez_Gridview.aspx "A conclusion is where you got tired of thinking.Be different. Think "Remember to click “Mark as Answer” on the post If you get answer from my post(s) !Thanks Guys------------Pushkar  HI.. its very simple.. all you have to do is to ...

About Today's (2005-01-07) Article 'Change the style of a column within a GridView control based on its value'
Hi I read the article, sounded interesting although I've done it several times in asp.net (vb), not in C# as this article is. I wonder what the author tries to prove with this article since you cannot run it and see what it does? Since there's some hints that it might be using the Northend database there's no sign of it in the code, thus you can't do anything. Has the author deliberatly left out the datasource so that noone will ever know what the code does? Or is it so that he never thoght of the datasource since that worked in his machine, and he thought if it does work on hi...

Urgent: Freeze GridView Column Headers !!
Hello, I have a GridView control on my ASP.NET page, which is getting populated with thousands of rows on a button click.So I want to fix my Grid Headers, so that i can scroll with fix grid height, Please let me know if anybody have done this before. Thanks in Advance! Regards, Aditya Soni    GridView Fixed Column Header Regards,Vinz"Code, Beer and Music" that's my way of being a programmer!How to get your Forum Question Answered | Blog | CodeASP.NET Hi Aditya.Freeze Header"A conclusion is where you got tired of thinking.Be different. Think "Rem...

Gridview freeze First Two Columns
I M Using GridView ,i Want to freeze first two Columns of the grid,I tried a sample code. it serves the purpose ,but when i scroll the columns get overlapped,scrolled columns overlap with static columns...   Please Suggest??   Also i want to freeze the header of gridview.??? You want to merge two column value in one column. Like Name = First Name + Last Name <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1"> <Columns> <asp:BoundField DataField="Sr.No" Head...

GRIDVIEW's column's right-click
Hi, I would like to make right-click on gridview's Hyperlink Field  where i will able to do actions and redirect to other Reports in short some kind of WINDOWS functionality on WEB, i am also using AJAX, if any body has any idea please let me know. Thanks ~Parth  ThanksParthvisit for some interesting articals at www.parthrawal.blogspot.comMark as Answer if it helps you hi i am done with it please follow the link  http://aspalliance.com/946ThanksParthvisit for some interesting articals at www.parthrawal.blogspot.comMark as Answer if it helps you...

Web resources about - GridView : Freezing First Columns and Freezing Column's Headers - asp.net.presentation-controls

Resources last updated: 1/6/2016 10:46:36 AM