Sep 17, 2008, 3:10 PM
[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".
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.