[CLOSED] GridPanel with datasource provided by a xml

  1. #1

    [CLOSED] GridPanel with datasource provided by a xml

    Good afternoon, this is my first post.

    I'm studying the controls of the Coolite.
    I've stopped when I was trying get data of my xml to put they in my datagrid, the format of my xml is:
    <tabela>
    <quantidade>38</quantidade>
    <data>
    <linha>
    <id>1</id>
    <nome>Name1</nome>
    <apelido>Nickname1</apelido>
    </linha>
    <linha>
    <id>2</id>
    <nome>Name2</nome>
    <apelido>Nickname2</apelido>
    </linha>
    </tabela>
    The tag tabela is the root, each linha contains the data required by my datagrid.

    The following code is "what I was trying to do to get the data of my xml source".

    
    
    
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="teste.aspx.cs" Inherits="EggTeste1.admin.coolite.teste" %>
    
    
    <%@ Register assembly="Coolite.Ext.Web" namespace="Coolite.Ext.Web" tagprefix="ext" %>
    
    
    <!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>TesteDoGridPanel</title>
    
    
    </head>
    
    
    <body>
    
    
    <form id="form1" runat="server">
    
    
    <ext:ScriptManager ID="ssssw" runat="server"></ext:ScriptManager>
    
    
    <div id="saida" runat="server">
    
    
    <asp:XmlDataSource ID="xmlDataSource" runat="server" DataFile="http://localhost:2042/xml/UsuariosFiltro.aspx">
    
    
    </asp:XmlDataSource>
    
    
    <ext:Store ID="store1" runat="server" DataSourceID="xmlDataSource"
    
    
    AutoLoad="true"
    
    
    >
    
    
    <Reader>
    
    
    <ext:XmlReader
    
    
    Record="linha"
    
    
    ReaderID="id"
    
    
    TotalRecords="quantidade"
    
    
    >
    
    
    <Fields>
    
    
    <ext:RecordField Mapping="id" Name="id" Type="Int"></ext:RecordField>
    
    
    </Fields>
    
    
    </ext:XmlReader>
    
    
    </Reader>
    
    
    </ext:Store>
    
    
    <ext:GridPanel ID="GridPanel1" runat="server" StoreID="store1"
    
    
    Width="200"
    
    
    Height="300"
    
    
    Frame="true"
    
    
    Title="Teste">
    
    
    <ColumnModel runat="server" ID="ff">
    
    
    <Columns>
    
    
    <ext:Column DataIndex="id" Header="id"></ext:Column>
    
    
    </Columns>
    
    
    </ColumnModel>
    
    
    </ext:GridPanel>
    
    
    
    
    
    
    </form>
    
    
    </body>
    
    
    </html>
    I don't understand why I couldn't use this to get my data, I'm using only the column id.
  2. #2

    RE: [CLOSED] GridPanel with datasource provided by a xml



    Hi Petherson,

    Welcome!

    The following example demonstrates binding the <ext:Store> + <ext:GridPanel> to an <asp:XmlDataSource>, see http://sandbox.ext.net/GridPanel/Dat...ataSource.aspx

    The following example demonstrates connecting to an asp.net webservice which returns XML. It might be helpful as well in diagnosing the problem, see http://sandbox.ext.net/GridPanel/PlantDemo/Plants.aspx

    Hope this helps.
    Geoffrey McGill
    Founder
  3. #3

    RE: [CLOSED] GridPanel with datasource provided by a xml

    Hi Geoffrey, thank you for your help.

    Now, I will use your helpful post.



  4. #4

    RE: [CLOSED] GridPanel with datasource provided by a xml

    Hi Geoffrey, I got it, thank you for your help.

    I was using the wrong control.

    Thanks.

    Bye bye.

Similar Threads

  1. Replies: 2
    Last Post: Apr 11, 2012, 11:10 AM
  2. Replies: 5
    Last Post: Feb 01, 2012, 11:54 AM
  3. Gridpanel + datasource
    By Francis in forum 1.x Help
    Replies: 1
    Last Post: Oct 01, 2010, 9:09 PM
  4. gridpanel.DataSource = Where are you?
    By unperson in forum 1.x Help
    Replies: 2
    Last Post: Sep 07, 2009, 10:52 PM
  5. [CLOSED] GridPanel Datasource from Code Behind
    By amitpareek in forum 1.x Help
    Replies: 10
    Last Post: Nov 16, 2008, 2:53 PM

Posting Permissions