I find that manually sizing a grid to accommodate exactly the column widths is tedious, and impossible if columns are pro grammatically hidden or made visible. It would be rally nice to have a feature where the grid width adjusts based on events such as hiding a column, or column re-sizing. In the meantime the following does the job (it just has to be called in user code...)
Code: C#
public static void SetGridWidth(EO.Web.Grid grid)
{
int width = 0;
for (int index = 0; index < grid.Columns.Count; index++)
{
if (grid.Columns[index].Visible)
width += grid.Columns[index].Width;
}
grid.Width = new Unit(width);
}