I Have a display that needs to be a little more dynamic than what I\'m use to and can\'t seem to quite find the answer I need.
Custom
You may use a GridView with AutoGenerateColumns="true". This will create your collumns based on the Datasource you are binding.
Consider this class
public class A
{
public string Field1 { get; set; }
public int Field2 { get; set; }
}
And this code
GridView1.DataSource = new List() {
new A() { Field1 = "a", Field2 = 1 },
new A() { Field1 = "b", Field2 = 2 },
new A() { Field1 = "c", Field2 = 3 },
};
GridView1.DataBind();
This will generate an HTML Table with to columns named Field1 and Field2 with the corresponding 3 rows. Somthing like this.
Field1
Field2
a
1
b
2
c
3
If you change the datasource to another source with differnt columns it will automatically generate the corresponding columns for you.