I’ve been using Obout Grid for a project and I must say it’s a really great control. One issue I encountered though was when I required the ability to have columns auto generated yet still set certain properties on columns should they be included in the grid.
This is typically what your grid would look like if you declaratively set your columns.
- <obout:Grid id="grid1" runat="server">
- <obout:Column ID="Column1" DataField="Website" HeaderText="WEBSITE" ParseHTML="true" runat="server" />
No examples on the Obout site show how to do this programmatically, but by poking around the library I was able to figure it out fairly easily:
- Results.DataSource = Table;
- foreach (Column c in from Column c in Results.Columns where c.HeaderText == "Edit" || c.HeaderText == "View" select c)
- c.ParseHTML = true;
- c.Width = "75";
- c.Align = "center";