Home > Net >  In c # propertyGrid control how to display the List data
In c # propertyGrid control how to display the List data

Time:03-26

In c # propertyGrid List data not in... Button shows, but the list data to show a detailed

CodePudding user response:

Number of data in the List is not sure, but the PropertyGrid items need to be sure, can not achieve this effect,

CodePudding user response:

 protected override void onl oad (EventArgs e) 
{
Base. The onl oad (e);

TestData data=https://bbs.csdn.net/topics/new TestData ();
Data. Names=new List (a);
Data. The Names. The Add (" * * ");
Data. The Names. The Add (" li si ");
Enclosing propertyGrid1. SelectedObject=data;
}

Public class TestData
{
Public List Names the {get; set; }

Public string [] Names1 {get {return Names. The ToArray (); } the set {Names. The Clear (); Names. AddRange (value); }}
}


So that we can do big, need not enter the child form,

CodePudding user response:

The
reference rabbit party at large on the second floor response:
 protected override void onl oad (EventArgs e) 
{
Base. The onl oad (e);

TestData data=https://bbs.csdn.net/topics/new TestData ();
Data. Names=new List (a);
Data. The Names. The Add (" * * ");
Data. The Names. The Add (" li si ");
Enclosing propertyGrid1. SelectedObject=data;
}

Public class TestData
{
Public List Names the {get; set; }

Public string [] Names1 {get {return Names. The ToArray (); } the set {Names. The Clear (); Names. AddRange (value); }}
}


So that we can do big, need not enter the child form,


I now of the actual situation is a kind of medium List
  •  Tags:  
  • C#
  • Related