GridPanel showing only one column of data

  1. #1

    GridPanel showing only one column of data

    Hi,

    Stumbled across these .net components after searching for a gridview, with some more advanced features.

    I seem to be having a problem with the GridPanel using an objectdatasource.
    I've looked at the sample and tried to set it up on my page, but it is only showing one column of data.

    Here is the code from my page:
        <ext:GridPanel ID="GridPanel1" runat="server" Height="300" Title="Candidate Details">
            <Store>
                <ext:Store DataSourceID="odsCandidates" runat="server">
                    <Reader>
                        <ext:JsonReader IDProperty="ID_NUMBER">
                            <Fields>
                                <ext:RecordField Name="CANDIDATE_NO" />
                                <ext:RecordField Name="UCI_NO" />
                                <ext:RecordField Name="LEARNER" />
                                <ext:RecordField Name="DATE_OF_BIRTH" Type="Date" />
                            </Fields>
                        </ext:JsonReader>
                    </Reader>
                </ext:Store>
            </Store>
            <ColumnModel runat="server">
                <Columns>
                    <ext:Column ColumnID="candNo" Header="City & Guilds/Edexcel No" Locked="true" />
                    <ext:Column ColumnID="uciNo" Header="UCI No" />
                    <ext:Column ColumnID="fullName" Header="Candidate Name" />
                    <ext:Column ColumnID="dob" Header="Date Of Birth">
                        <Renderer Format="Date" />
                    </ext:Column>
                </Columns>
            </ColumnModel>
            <SelectionModel>
                <ext:RowSelectionModel SingleSelect="true" runat="server" />
            </SelectionModel>
            <View>
                <ext:LockingGridView runat="server" />
            </View>
        </ext:GridPanel>
        <asp:ObjectDataSource ID="odsCandidates" runat="server" SelectMethod="GetStudents" 
                TypeName="StudentBLL" onselecting="odsCandidates_Selecting">
            <SelectParameters>
                <asp:Parameter Name="course" Type="String" />
                <asp:Parameter Name="module" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>
    The only data that is showing in the GridPanel is the LEARNER column, all the other columns come back with no data.
    I've double checked the field names are correct from the datasource.
    The only difference between the field names are the _ between the words.
    Does the GridPanel not like them, or am I missing something else?

    Thanks,
  2. #2
    Hi,

    You have to define DataIndex for columns, see examples from Examples Explorer
    https://examples1.ext.net/#/GridPane...ectDataSource/
  3. #3
    Thanks,

    I also forgot to use the DateColumn.

Similar Threads

  1. GridPanel showing data return Store.Count value 0
    By abhi_sheklohiya in forum 1.x Help
    Replies: 3
    Last Post: Mar 26, 2012, 7:06 PM
  2. Replies: 1
    Last Post: Feb 19, 2012, 1:07 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. Gridpanel not showing column names
    By unaltro2 in forum 1.x Help
    Replies: 3
    Last Post: Feb 16, 2010, 1:54 PM
  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