Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Dataset and XML

Dataset and XML

Scheduled Pinned Locked Moved ASP.NET
csharpcsssysadmindockerxml
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Farraj
    wrote on last edited by
    #1

    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>

    E 1 Reply Last reply
    0
    • F Farraj

      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>

      E Offline
      E Offline
      Estys
      wrote on last edited by
      #2

      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

      F 1 Reply Last reply
      0
      • E Estys

        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

        F Offline
        F Offline
        Farraj
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups