No data showing

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    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 ...,

    <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
  2. #2
    Hi,

    Please see the example how to use ObjectDataSource with Store.
    http://examples1.ext.net/#/GridPanel...ectDataSource/
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi,

    Please see the example how to use ObjectDataSource with Store.
    http://examples1.ext.net/#/GridPanel...ectDataSource/
    Thanks Daniil,

    I did have a look at the ObjectDataStore sample but I hadn't noticed it was using a JsonReader rather than an ArrayReader... that did the trick.


    Cheers,

Similar Threads

  1. Linked combo boxes not showing data
    By reezvi in forum 1.x Help
    Replies: 2
    Last Post: Aug 03, 2011, 7:33 AM
  2. GridPanel showing only one column of data
    By HexElffilter in forum 1.x Help
    Replies: 2
    Last Post: Jan 27, 2011, 3:42 PM
  3. GridPanel not showing all data
    By iltwams in forum 1.x Help
    Replies: 1
    Last Post: Oct 01, 2010, 6:09 PM
  4. Grid Panel not showing complete data
    By Nagaraj K Hebbar in forum 1.x Help
    Replies: 2
    Last Post: Aug 17, 2009, 10:42 AM
  5. GridPanel not showing data with ajaxMethod
    By fabiomarcos in forum 1.x Help
    Replies: 3
    Last Post: Aug 12, 2009, 7:50 PM

Posting Permissions