将Listview绑定到多个Object数据源ASP.net 3.5

时间:2010-09-28 18:38:52

标签: listview binding object hierarchical-data

我使用Object作为Listview的数据源,并尝试以分层方式显示数据。我无法弄清楚如何将这些对象绑定到我的列表视图。下面粘贴的是代码。 我试图将Listview放在另一个listview中,在另一个listview中,以便以分层方式显示数据。很感谢任何形式的帮助。 提前致谢 微米。

 
public class AutoElements 
    {
       public class results_dataset
        {
            public List claimsHistory { get; set; }
            public int count {get; set;}
        }
       public class Claims_history
        {
            public List claim { get; set; }
        }
        public class Claim : ClaimType
        {
            public string first_payment_date { get; set; }

        }
     }
 

从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()

        }
  }

} }

 

0 个答案:

没有答案
相关问题