views:

1755

answers:

5

I need a grid that will allow me to freeze a column (the Ms Excel style). I do not need to freeze rows.

Of course the Asp.net 2.o Gridview does not supports this out of the box.

I am sure someone has had a similar requirement and had a way foward.

Please advise any options available with the Gridview. I am also open to using any third party grids out there, so please provide any indicators too.

I develop web apps in Asp.net 2.0

A: 

I don't know if this is possible with the in-box GridView, but the Infragistics UltraWebGrid does support it. (It's called "fixed columns" in that.) However, IG is very expensive and has a pretty sharp learning curve, so you may be better suited with a different component suite for this. Others here are more familiar with the other offerings.

John Rudy
+1  A: 

This can be achieved using the css classes for the GridView.

If you need a IE only solution, you can check the below link. http://home.tampabay.rr.com/bmerkey/examples/locked-column-csv.html

Ramesh
Good one. Actually am looking at IE only solution - for company intranet. up vote for the link
J Angwenyi
+1  A: 

Here's a possibility:

<asp:GridView ID="gvFixed" runat="server" DataSourceID="MyDataSource">
</asp:GridView>
<div style="float:left; overflow-x:scroll; width:400px;">
    <asp:GridView ID="gvScrolling" runat="server" DataSourceID="MyDataSource">
     </asp:GridView>
</div>

Use 2 gridviews bound to the same DataSource. By wrapping the "unfrozen" columns in a div with overflow-x:scroll, the second gridview/table will scroll horizontally with the first gridview appearing to a fixed column(s). This would also work for fixed headers

HectorMac
Interesting...Will try this out as well
J Angwenyi
A: 

Could you please send the whole Code..I need to look it after it Plzzz....

A: 

HectorMac...

Is there a way to link paging for the two grids??? i have about 400+ records and have paging enabled ...so I need to be able to have the two grids page together

Thanks..