Mar 22, 2012, 1:06 AM
No data showing
Hi,
I have pretty much copied your FormPanel Basic example but supplying a objectDatasource instead of the sample one. I have changed the reader, the column model and TextFields to match the columns returned from my datasource, the datasource is correct, everything should be fine, but I am getting the right amount of rows but no data is showing.
Tearing my hair out...
I have made this code sample as simple as possible to align with your FormPanel example ...,
Code behind:
I have pretty much copied your FormPanel Basic example but supplying a objectDatasource instead of the sample one. I have changed the reader, the column model and TextFields to match the columns returned from my datasource, the datasource is correct, everything should be fine, but I am getting the right amount of rows but no data is showing.
Tearing my hair out...
I have made this code sample as simple as possible to align with your FormPanel example ...,
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
OldValuesParameterFormatString="original_{0}" SelectMethod="GetData"
TypeName="Ext_1._3_SDDB2.SDDB2TableAdapters.GetSpecsByTypeTableAdapter">
<SelectParameters>
<asp:Parameter DefaultValue="3" Name="SpecTypeId" Type="Int32" />
<asp:Parameter DefaultValue="4" Name="Modelers_WspId" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
<ext:Store ID="Store1" runat="server">
<Reader>
<ext:ArrayReader>
<Fields>
<ext:RecordField Name="SpecVnId" />
<ext:RecordField Name="Spec"/>
<ext:RecordField Name="Description"/>
</Fields>
</ext:ArrayReader>
</Reader>
</ext:Store>
<ext:Panel ID="Panel1" runat="server" Width="1000" Height="300">
<Items>
<ext:BorderLayout ID="BorderLayout1" runat="server">
<West>
<ext:GridPanel
ID="GridPanel1"
runat="server"
StoreID="Store1"
StripeRows="true"
Title="Grid"
TrackMouseOver="true"
Width="700">
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column ColumnID="SpecVnId" Header="SpecVnId" Width="160" DataIndex="SpecVnId" />
<ext:Column Header="Spec" Width="75" DataIndex="Spec"/>
<ext:Column Header="Description" Width="75" DataIndex="Description"/>
</Columns>
</ColumnModel>
</ext:GridPanel>
</West>
<Center>
<ext:FormPanel ID="FormPanel1" runat="server" Title="Form Panel" Padding="5" ButtonAlign="Right">
<Items>
<ext:TextField ID="SpecVnId" DataIndex="SpecVnId" runat="server" FieldLabel="SpecVnId" AnchorHorizontal="95%" />
<ext:TextField ID="Spec" DataIndex="Spec" runat="server" FieldLabel="Spec" AnchorHorizontal="95%" />
<ext:TextField ID="Description" DataIndex="Description" runat="server" FieldLabel="Description" AnchorHorizontal="95%" />
</Items>
</ext:FormPanel>
</Center>
</ext:BorderLayout>
</Items>
</ext:Panel>
</form>
Code behind:
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
System.Data.DataView dv = new System.Data.DataView();
ObjectDataSource1.SelectParameters["SpecTypeId"].DefaultValue = "3";
ObjectDataSource1.SelectParameters["Modelers_WspId"].DefaultValue = "4";
dv = (System.Data.DataView)ObjectDataSource1.Select();
this.Store1.DataSource = dv;
this.Store1.DataBind();
}
}
Last edited by Daniil; Mar 22, 2012 at 7:47 AM.
Reason: Please use [CODE] tags