分层GridView asp.net 3.5

时间:2010-09-24 21:50:25

标签: listview

关于如何实现'Hierarchical'gridview的任何想法?我想要的是亲子级联(多级)。  我正在使用LINQ to XML从XML文件中获取数据并将其保存在C#对象中,并将ListView控件中的数据显示为具有所有不同级别的层次结构。 (C#对象是Listview控件的数据源)。 提前致谢。 中号

请有人帮帮我..

我的C#对象:

1)AutoElements类:

 
public class AutoElements : CommonElements
    {
       public class results_dataset
         {
            public List claimsHistory { get; set; }
          }      
        public class Claims_history
        {
            public List claim { get; set; }
            public typesectionEnum type; // attribute 
        }

        public class Claim : ClaimType
        {
            public string first_payment_date { get; set; }
            public ClaimAssociationIndicatorEnum claim_association_indicator;
            public List vehicle; 
        }

    } 

2)共同元素类:

 public  class CommonElements : CPRulesCommonElements 
  {
     public class ClaimType
        {
            public string  claim_date { get; set; }
            public int claim_Age_Years {get; set;}
            public int claim_Age_Months { get; set; }
            public List policy { get; set; }
            public List subject { get; set; }
            public List address { get; set; }
        }

 public class SubjectType  : BaseSubjectType
      {
        public int unit_number {get; set;}
        public IDREF id {get; set;}
        public string id { get; set; }

      }
    public class BaseSubjectType
    {
        public string birthdate { get; set; }
        public GenderEnum gender { get; set; }
        public string ssn { get; set; }
        public string deathdate { get; set; }
        public string quoteback { get; set; }
        public List address { get; set;}
        public TelephoneType telephone { get; set; }
        public List driversLicense { get; set; }
     }
 public class DriversLicenseType : CPdriversLicenseType 
    {
        public DriversLicenseClassificationEnum classification { get; set; }
        public LenientDateType issue_date { get; set; }
        public string issue_date { get; set; }
        public LenientDateType expiration_date { get; set; }
        public string expiration_date { get; set; }
        public FSIEnum fsi_state { get; set; }
        public FSIEnum fsi_number { get; set; }
        public FSIEnum fsi_classification { get; set; }
        public string license_type { get; set; }
    }
}  

3)CPRulesCommonElements:

   public class CPRulesCommonElements : Enums

    {
       public class telephoneType
        {
            public TelephoneTypeEnum type { get; set; }
            public string country { get; set; }
            public string area { get; set; }
            public string exchange { get; set; }
            public string number {get; set;}
            public string extension {get; set;}
        }
        public class driversLicenseType
        {
            public List parameter { get; set; }
            public DriversLicenseHistoryEnum history { get; set; }
            public DriversLicenseTypeEnum type { get; set; }
            public string state { get; set; }
            public string number { get; set; }

        }  

1 个答案:

答案 0 :(得分:0)

我不认为使用GridView可以实现这一点,但可以使用ListView。

请参阅http://mattberseth.com/blog/2008/01/building_a_grouping_grid_with.html以获得一个好例子。