Height problems in grid

8 replies. Last post: April 7, 2011 9:49 AM by Adam Davis
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
Adam DavisMember

We have grids in our system that cut the row with the horizontal and vertical scrollbars if there is 1-2 rows in the grid. All IE versions. It works fine in Google Chrome.

We can't set an explicit height for the grid because we don't want a lot of white space at the bottom of the grid, so we rely on the grid to resize appropriately.

I've attached a sample and a screen shot.

 

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <%@ Register Assembly="ISNet.WebUI.WebGrid" Namespace="ISNet.WebUI.WebGrid" TagPrefix="ISNet" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script runat="server"> public class GridContent

{

public string SecurityRoleNameText { get; set; } public string SecurityRoleNameUrl { get; set; } public string OwnerCompany { get; set; } public int Assigned { get; set; }

}

protected void Page_Load(object sender, EventArgs e)

{

//Manually sets the grid columns below to 337 pixels each.

WebGrid3.RootTable.ColumnWidthDefault=337;

}

protected void Grid_InitializeDataSource(object sender, DataSourceEventArgs e)

{

System.Collections.Generic.
List<GridContent> dummyData = new System.Collections.Generic.List<GridContent>()

{

new GridContent() { SecurityRoleNameText="Administrator 1", SecurityRoleNameUrl="", OwnerCompany="Company", Assigned=1 }

};

e.DataSource = dummyData;

WebGrid3.DataBind();

}

</script>

</head><

body> <form id="form1" runat="server"> <div> <IsNet:WebGrid ID="WebGrid3" runat="server" Width="100%" OnInitializeDataSource="Grid_InitializeDataSource" UseDefaultStyle="True" DefaultStyleMode="Elegant"> <RootTable Caption="New Title" > <Columns> <IsNet:WebGridColumn Name="Name" DataMember="SecurityRoleNameText" Caption="Name" /> <IsNet:WebGridColumn Name="SecurityRoleNameUrl" DataMember="SecurityRoleNameUrl" Caption="SecurityRoleNameUrl" /> <IsNet:WebGridColumn Name="OwnerCompany" DataMember="OwnerCompany" Caption="OwnerCompany" /> <IsNet:WebGridColumn Name="Assigned" DataMember="Assigned" Caption="Assigned" /> </Columns> </RootTable> <LayoutSettings AllowFilter="Yes" AutoHeight="true" AllowGrouping="Yes" AllowEdit="Yes" AllowSorting="Yes" AllowColumnSizing="Yes" PagingMode="ClassicPaging"> </LayoutSettings>

</IsNet:WebGrid>

</div> </form>

</body>

</html>

 

 

1 attachment
All times are GMT -5. The time now is 12:46 AM.
Previous Next