asp.net - How To Freeze Columns in GridView -
i'm trying freeze columns in gridview grid has static height , rows rendered(no paging , scroll var visible). managed add scroll through content overflow property,but time columns scrolling well.my task freeze columns while maintaining column width.
let grid
<div style="height:200px;overflow:auto;"> <asp:gridview id="gridview1" runat="server" autogeneratecolumns="false" useaccessibleheader="true or false"> <columns> <asp:boundfield datafield="name" headertext="name" /> <asp:boundfield datafield="surname" headertext="surname" /> </columns> </asp:gridview> </div>
and code view
public class person { public string name { get; set; } public string surname { get; set; } }
->on page load
list<person> lst = new list<person>(); lst.add(new person() { name = "a", surname = "a1" }); lst.add(new person() { name = "b", surname = "b1" }); lst.add(new person() { name = "c", surname = "c1" }); lst.add(new person() { name = "d", surname = "d1" }); lst.add(new person() { name = "e", surname = "e1" }); lst.add(new person() { name = "f", surname = "f1" }); lst.add(new person() { name = "g", surname = "g1" }); lst.add(new person() { name = "h", surname = "h1" }); lst.add(new person() { name = "i", surname = "i1" }); lst.add(new person() { name = "j", surname = "j1" }); lst.add(new person() { name = "k", surname = "k1" }); gridview1.datasource = lst; gridview1.databind();
how can achieve minimum effort of coding or styling?
note:rendered browser ie only.
you use ideasparks coolgridview instead. works fine me , free.
- download codeplex.com.
Comments
Post a Comment