maadhukari
Programmer
Hello,
I am using Object as the data source to my Listview and trying to display data in a Hierarchical manner. I am not able to figure out how to bind these objects to my listviews. Below pasted is the code.
I am trying to place Listview inside another listview, inside another listview inorder to display data in a hierarchical manner. Any help is very much appreciated.
???? area below is where i need help.
Thanks in advance
M.
public class AutoElements
{
public class results_dataset
{
public List<Claims_history> claimsHistory { get; set; }
public int count {get; set;}
}
public class Claims_history
{
public List<Claim> claim { get; set; }
}
public class Claim : ClaimType
{
public string first_payment_date { get; set; }
}
}
Code to extract data from XML :
public class ClaimsProcessing
{
public AutoElements.results_dataset GetResultDataset()
{
AutoElements.results_dataset resultdatasets =
(from b in query.Descendants(xmlns + "results_dataset")
select new AutoElements.results_dataset
{
claimsHistory = (from c in query.Descendants(xmlns + "claims_history")
select new
AutoElements.Claims_history
{
claim = (from d in query.Descendants(xmlns + "claim")
select new AutoElements.Claim()
{
first_payment_date = d.Element(xmlns+"fpdate").Value
}
}
}.ToList(),
count = (int) (int)c.Elements(xmlns + "claim").Count()
}
}
<asp:ObjectDataSource ID="ClueAutoElements" runat="server" SelectMethod="GetResultDataset"
TypeName="CLUEAuto.BusinessLogic.ClaimsProcessing"></asp:ObjectDataSource>
<asp:ListView ID="lv" runat="server" DataSourceID="ClueAutoElements" OnSorting="LvSorting" OnSorted="LvSorted">
<ItemTemplate>
<tr id="row" runat="server" class="group">
<th class="first" runat="server">
<img src="_assets/img/plus.png" alt='Group: <%# Eval("claimsHistory") %>' />
</th>
<th colspan="5" runat="server">(<%# Eval("count") %> )</th>
</tr>
????? <asp:ListView ID="lvItems" runat="server" DataSourceID='<%# Eval("?????") %>'>
????? </asp:ListView>
</ItemTemplate></asp:ListView>
I am using Object as the data source to my Listview and trying to display data in a Hierarchical manner. I am not able to figure out how to bind these objects to my listviews. Below pasted is the code.
I am trying to place Listview inside another listview, inside another listview inorder to display data in a hierarchical manner. Any help is very much appreciated.
???? area below is where i need help.
Thanks in advance
M.
public class AutoElements
{
public class results_dataset
{
public List<Claims_history> claimsHistory { get; set; }
public int count {get; set;}
}
public class Claims_history
{
public List<Claim> claim { get; set; }
}
public class Claim : ClaimType
{
public string first_payment_date { get; set; }
}
}
Code to extract data from XML :
public class ClaimsProcessing
{
public AutoElements.results_dataset GetResultDataset()
{
AutoElements.results_dataset resultdatasets =
(from b in query.Descendants(xmlns + "results_dataset")
select new AutoElements.results_dataset
{
claimsHistory = (from c in query.Descendants(xmlns + "claims_history")
select new
AutoElements.Claims_history
{
claim = (from d in query.Descendants(xmlns + "claim")
select new AutoElements.Claim()
{
first_payment_date = d.Element(xmlns+"fpdate").Value
}
}
}.ToList(),
count = (int) (int)c.Elements(xmlns + "claim").Count()
}
}
<asp:ObjectDataSource ID="ClueAutoElements" runat="server" SelectMethod="GetResultDataset"
TypeName="CLUEAuto.BusinessLogic.ClaimsProcessing"></asp:ObjectDataSource>
<asp:ListView ID="lv" runat="server" DataSourceID="ClueAutoElements" OnSorting="LvSorting" OnSorted="LvSorted">
<ItemTemplate>
<tr id="row" runat="server" class="group">
<th class="first" runat="server">
<img src="_assets/img/plus.png" alt='Group: <%# Eval("claimsHistory") %>' />
</th>
<th colspan="5" runat="server">(<%# Eval("count") %> )</th>
</tr>
????? <asp:ListView ID="lvItems" runat="server" DataSourceID='<%# Eval("?????") %>'>
????? </asp:ListView>
</ItemTemplate></asp:ListView>