This is a migrated thread and some comments may be shown as answers.

How to charge XML structure in RadGrid, and update/delete/insert?

2 Answers 116 Views
Grid
This is a migrated thread and some comments may be shown as answers.
gonzalo
Top achievements
Rank 1
gonzalo asked on 31 Dec 2008, 01:41 PM
HI
me question...
How to charge XML structure in RadGrid, and update/delete/insert?
Structure XML
<?xml version="1.0" standalone="yes"?>  
<DocumentElement> 
  <CoordsInput> 
    <comuna>ECE</comuna> 
    <name>ECT023</name> 
    <xCoord>-29.90716572</xCoord> 
    <yCoord>-70.7073</yCoord> 
  </CoordsInput> 
  <CoordsInput> 
    <comuna>MAI</comuna> 
    <name>MAI001</name> 
    <xCoord>-33.56446522</xCoord> 
    <yCoord>-70.78931253</yCoord> 
  </CoordsInput> 
</DocumentElement> 

Sorry me bad english

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 02 Jan 2009, 06:10 AM
Hello Gonzalo,

You can go through the following links on how to populate a grid from an Xml file and perform Update/Insert/Delete in the grid.
Populating Telerik RadGrid from XML - this help document explains on how to load the structure of a RadGrid control from a file containing its XML representation.

Editing XML using XmlDataSource - this online demo link demonstrates on how to perform various data operations on a grid bound using Xml.

You can also refer to the following code library example I have submitted, for more information on editing In RadGrid using Xml.
Batch Update in RADGRID using XML as Datasource

Thanks
Princy.
0
gonzalo
Top achievements
Rank 1
answered on 02 Jan 2009, 03:20 PM
Hi... thx for reply
not work me code using XmlDataSource
look
Code .aspx
Programing in .vb
<asp:XmlDataSource ID="XmlDataSource1" runat="server"   
        DataFile="~/App_Data/newcoords.xml"   
        XPath="DocumentElement/CoordsInput">  
    </asp:XmlDataSource> 

<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False"   
        DataSourceID="XmlDataSource1" GridLines="None">  
<HeaderContextMenu EnableTheming="True">  
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
</HeaderContextMenu> 
 
<MasterTableView datasourceid="XmlDataSource1">  
<RowIndicatorColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</RowIndicatorColumn> 
 
<ExpandCollapseColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</ExpandCollapseColumn> 
    <Columns> 
        <telerik:GridBoundColumn DataField="comuna" UniqueName="comuna">  
        </telerik:GridBoundColumn> 
    </Columns> 
</MasterTableView> 
 
<FilterMenu EnableTheming="True">  
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
</FilterMenu> 
    </telerik:RadGrid> 



shows no content

and fine work
code:

 Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load  
        Dim tocDataSet As New DataSet("DocumentElement")  
        tocDataSet.ReadXml(Server.MapPath("~/App_Data/newcoords.xml"))  
        RadGrid1.DataSource = tocDataSet  
        RadGrid1.DataBind()  
 
    End Sub 

i need this code update/edit/delte/insert content

 

thx Princi

Tags
Grid
Asked by
gonzalo
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
gonzalo
Top achievements
Rank 1
Share this question
or