Feb 24, 2011, 9:44 AM
I forgot to take out fixed height of 'desired' before posting
I tried adding a main/right column, but it didnt work out.
Also, this code doesnt create a horizontal scroll bar, it moves the grid around when the screen size is reduced. Try reducing the screen on www.ext.net to see the difference. A commercial site's layout works like www.ext.net (plus center for mine).
Please, mark as solved. I cant afford to spend more time on this.
Thank you for all you help, but this is consuming too much of my time, leaving no time for other parts of the site.
I tried adding a main/right column, but it didnt work out.
Also, this code doesnt create a horizontal scroll bar, it moves the grid around when the screen size is reduced. Try reducing the screen on www.ext.net to see the difference. A commercial site's layout works like www.ext.net (plus center for mine).
Please, mark as solved. I cant afford to spend more time on this.
Thank you for all you help, but this is consuming too much of my time, leaving no time for other parts of the site.
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
this.Store1.DataSource = this.Data;
this.Store1.DataBind();
}
}
private object[] Data
{
get
{
return new object[]
{
new object[] { "3m Co", 71.72, 0.02, 0.03, "9/1 12:00am" },
new object[] { "Alcoa Inc", 29.01, 0.42, 1.47, "9/1 12:00am" },
new object[] { "Altria Group Inc", 83.81, 0.28, 0.34, "9/1 12:00am" }
};
}
}
</script>
<!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>Ext.Net Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:Viewport runat="server" Layout="FitLayout">
<Items>
<ext:Container runat="server" AutoScroll="true" Layout="hbox" StyleSpec="position: relative;">
<LayoutConfig>
<ext:HBoxLayoutConfig Align="Middle" />
</LayoutConfig>
<Items>
<ext:Container runat="server" Flex="1" />
<ext:Container runat="server" Width="600">
<Items>
<ext:CompositeField runat="server">
<Items>
<ext:DisplayField runat="server" Text="Test" />
</Items>
</ext:CompositeField>
<ext:Container runat="server" AutoScroll="true" Layout="hbox" StyleSpec="position: relative;">
<LayoutConfig>
<ext:HBoxLayoutConfig Align="Middle" />
</LayoutConfig>
<Items>
<ext:Container runat="server" Flex="1">
<Items>
<ext:GridPanel ID="GridPanel1" runat="server" Title="Array Grid" Width="600" Height="200"
AutoExpandColumn="company">
<Store>
<ext:Store ID="Store1" runat="server">
<Reader>
<ext:ArrayReader>
<Fields>
<ext:RecordField Name="company" />
<ext:RecordField Name="price" Type="Float" />
<ext:RecordField Name="change" Type="Float" />
<ext:RecordField Name="pctChange" Type="Float" />
<ext:RecordField Name="lastChange" Type="Date" DateFormat="M/d hh:mmtt" />
</Fields>
</ext:ArrayReader>
</Reader>
</ext:Store>
</Store>
<ColumnModel runat="server">
<Columns>
<ext:Column ColumnID="Company" Header="Company" DataIndex="company" />
<ext:Column Header="Price" DataIndex="price">
</ext:Column>
<ext:Column ColumnID="Change" Header="Change" DataIndex="change">
</ext:Column>
<ext:Column Header="Change" DataIndex="pctChange">
</ext:Column>
<ext:DateColumn Header="Last Updated" DataIndex="lastChange" />
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel runat="server" SingleSelect="true" />
</SelectionModel>
</ext:GridPanel>
</Items>
</ext:Container>
<ext:Container runat="server" Width="150" />
</Items>
</ext:Container>
</Items>
</ext:Container>
<ext:Container runat="server" Flex="1" />
</Items>
</ext:Container>
</Items>
</ext:Viewport>
</form>
</body>
</html>