I've done:
- create a new webform.
- dragged a datagrid onto the webform.
- added a selfservicing collection to the toolbox (ThreadCollection, of this forum)
- I dragged the collection onto the form, I got 'threadCollection1'.
- I set the grid's datasource property to 'threadCollection1'. All columns show up.
- I clicked on the [...] button next to 'Columns'. This opens the property builder.
- I de-checked 'create columns automatically at runtime'
- Then I added 2 columns from the 'Available columnlist' to 'selected columns'
- I clicked OK. THe grid in the forum has now two columns.
The page_load routine:
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
threadCollection1.GetMulti(null);
DataGrid1.DataSource = threadCollection1;
DataGrid1.DataBind();
}
It works ok, I get 2 columns instead of 12 or so.
So, I think the main issue is that 'create columns automatically at runtime' is checked / set to true in your case I think.
As your collection dissapears when you compile, I'm not sure to which dll you've browsed when you added the collections to the toolbox. Perhaps you should use website\bin folder instead?