Rajkumar R

Rajkumar R

  • NA
  • 183
  • 219.5k

How to use single grid view for multiple xml file in C#

Mar 20 2012 12:10 AM
I have three XML file with different TAG names. Now i have used three gridview to BIND the xml data in grid view, can we able to bind three XML file dynamically in single gridview. 


<pre lang="HTML">
</asp:datagrid><asp:datagrid id="GridView2" Font-Size="13px" Runat="server" AutoGenerateColumns="False" BackColor="Seashell" BorderColor="#000033" HeaderStyle-Font-Bold="True">
<Columns>
<asp:TemplateColumn>
&lt;HeaderTemplate>
&lt;input id="chkAll2" onclick="javascript:SelectAllCheckboxes(this);" runat="server" type="checkbox" NAME="Checkbox4" />
&lt;/HeaderTemplate>
<ItemTemplate>
<asp:CheckBox id="Checkbox2" Runat="server"></asp:CheckBox>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="CLUSTERID">
<ItemTemplate>
<asp:Label ID="Label20" Text= '<%# DataBinder.Eval(Container.DataItem,"CLUSTERID")%>' runat="server">
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="UNITTYPE">
<ItemTemplate>
<asp:Label ID="Label21" Text= '<%# DataBinder.Eval(Container.DataItem,"UNITTYPE")%>' runat="server">
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="VPRCID">
<ItemTemplate>
<asp:Label ID="Label22" Text= '<%# DataBinder.Eval(Container.DataItem,"VPRCID")%>' runat="server">
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="YYYYMM">
<ItemTemplate>
<asp:Label ID="Label23" Text= '<%# DataBinder.Eval(Container.DataItem,"YYYYMM")%>' runat="server">
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid></pre>
<pre lang="HTML">
</asp:datagrid><asp:datagrid id="GridView3" Font-Size="13px" Runat="server" AutoGenerateColumns="False" BackColor="Seashell" BorderColor="#000033" HeaderStyle-Font-Bold="True">
<Columns>
<asp:TemplateColumn>
&lt;HeaderTemplate>
&lt;input id="chkAll3" onclick="javascript:SelectAllCheckboxes(this);" runat="server" type="checkbox" NAME="Checkbox4" />
&lt;/HeaderTemplate>
<ItemTemplate>
<asp:CheckBox id="Checkbox3" Runat="server"></asp:CheckBox>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="TYPELOAN">
<ItemTemplate>
<asp:Label ID="Label27" Text= '<%# DataBinder.Eval(Container.DataItem,"TYPELOAN")%>' runat="server">
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="AMOUNT">
<ItemTemplate>
<asp:Label ID="Label28" Text= '<%# DataBinder.Eval(Container.DataItem,"AMOUNT")%>' runat="server">
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="INSTALLMENT">
<ItemTemplate>
<asp:Label ID="Label29" Text= '<%# DataBinder.Eval(Container.DataItem,"NOOFINSTALLMENT")%>' runat="server">
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="INTEREST">
<ItemTemplate>
<asp:Label ID="Label30" Text= '<%# DataBinder.Eval(Container.DataItem,"RATEOFINTEREST")%>' runat="server">
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="PipCode">
<ItemTemplate>
<asp:Label ID="pipcode" runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Remark">
<ItemTemplate>
<asp:Label ID="Remark" runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>
</pre>
Instead of using two grid can we able to use single grid view for this
post solution for this
Thanks in Advance

Answers (3)