Dataset and XML
-
Hello guys, im trying to bind XML file into a Datagrid and editing it.. this is my XML file
<?xml version="1.0" encoding="utf-8"?>
<chores>
<day label="111" title="asdasd">
<job a="2" b="22" c="22" d="22" />
<job a="2" b="22" c="22" d="22" />
</day>
</chores>My ASPX Page:
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="EditTables.aspx.cs" Inherits="EditTables" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
<style type="text/css">
.style1 { width: 100%; } </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<table class="style1">
<tr>
<td>
<br />
<br />
Edit your Products tables<br />
</td>
</tr>
<tr>
<td>
<asp:DataGrid ID="DataGrid1" runat="server" AllowPaging="True" AllowSorting="True" CellPadding="4" ForeColor="#333333" GridLines="None" oncancelcommand="DataGrid1_CancelCommand" ondeletecommand="DataGrid1_DeleteCommand" oneditcommand="DataGrid1_EditCommand" onpageindexchanged="DataGrid1_PageIndexChanged" onupdatecommand="DataGrid1_UpdateCommand" AutoGenerateColumns="False" Width="890px">
<AlternatingItemStyle BackColor="White" ForeColor="#284775" />
<Columns>
<asp:TemplateColumn HeaderText=" label">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "label")%>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox id="txtBoxTitle"
Text='<%# DataBinder.Eval(Container.DataItem, "label") %>'
runat="server" Height="21px" Width="80px"/>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="title">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "title")%>
</ItemTemplate>
<EditItemTemplate> -
Hello guys, im trying to bind XML file into a Datagrid and editing it.. this is my XML file
<?xml version="1.0" encoding="utf-8"?>
<chores>
<day label="111" title="asdasd">
<job a="2" b="22" c="22" d="22" />
<job a="2" b="22" c="22" d="22" />
</day>
</chores>My ASPX Page:
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="EditTables.aspx.cs" Inherits="EditTables" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
<style type="text/css">
.style1 { width: 100%; } </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<table class="style1">
<tr>
<td>
<br />
<br />
Edit your Products tables<br />
</td>
</tr>
<tr>
<td>
<asp:DataGrid ID="DataGrid1" runat="server" AllowPaging="True" AllowSorting="True" CellPadding="4" ForeColor="#333333" GridLines="None" oncancelcommand="DataGrid1_CancelCommand" ondeletecommand="DataGrid1_DeleteCommand" oneditcommand="DataGrid1_EditCommand" onpageindexchanged="DataGrid1_PageIndexChanged" onupdatecommand="DataGrid1_UpdateCommand" AutoGenerateColumns="False" Width="890px">
<AlternatingItemStyle BackColor="White" ForeColor="#284775" />
<Columns>
<asp:TemplateColumn HeaderText=" label">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "label")%>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox id="txtBoxTitle"
Text='<%# DataBinder.Eval(Container.DataItem, "label") %>'
runat="server" Height="21px" Width="80px"/>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="title">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "title")%>
</ItemTemplate>
<EditItemTemplate>I found this : how to bind a DataGrid to a join of two tables in a DataSet?[^] Examine the columns and relations in your dataset : day day_Id day title day label job a job b job c job d job day_Id Relation : day_job day_Id and day_job are automagically created, don't know what it's values are. Cheers
-
I found this : how to bind a DataGrid to a join of two tables in a DataSet?[^] Examine the columns and relations in your dataset : day day_Id day title day label job a job b job c job d job day_Id Relation : day_job day_Id and day_job are automagically created, don't know what it's values are. Cheers
Hi Estys, Thank you.. I think this time im gonna let this go lol im gonna use this sample http://aspalliance.com/1873_Edit_XML_Files_Using_ASPNET_TreeView_Control.4[^] the only problem now im facing with that is that i cannot change or edit anything because i inserting Tags in the text box is not allowed, although i tried making validateRequest="false", still didnt work.