title: How to resize columns of DataGrid bound to List<T>, not DataSet?
body: <p>I'm trying to use a <code>System.Windows.Forms.DataGrid</code> control in my Compact Framework 3.5 Window Mobile Professional 6 SDK based project to show some properties of objects of type <code>Something</code> by binding the <code>DataGrid</code> to a <code>List&lt;SomethingWrapper&gt;</code> instance like this:</p>
  
  <pre><code>public class SomethingWrapper {
     private Something data;
     public SomethingWrapper(Something data) { this.data = data; }
     public string Column1 { get { /* string from this.data */ } }
     public string Column2 { get { /* string from this.data */ } }
  }
  
  public class SomethingList : List&lt;SomethingWrapper&gt; {
     public SomethingList(IEnumerable&lt;Something&gt; items) {
        foreach (var item in items) Add(new SomethingWrapper(item));
        Sort((a, b) =&gt; a.Column2.CompareTo(b.Column2);
     }
  }
  
  /* ... */
  
  IEnumerable&lt;Something&gt; dataToShow = /* assume this is filled correctly */
  SomethingDataGrid.DataSource = new SomethingList(dataToShow);
  </code></pre>
  
  <p>This seems to work fine: the correct data is shown in the grid with two columns called <code>Column1</code> and <code>Column2</code> and sorted on the second column. I want this to be a readonly view of this data, so all is fine.</p>
  
  <p><em>However, I would like to set column widths and cannot seem to get this to work...</em></p>
  
  <p>Have tried to obvious: creating <code>TableStyle</code>, creating textbox column style instance per column, adding it to the <code>TableStyle</code> and setting <code>SomethingDataGrid.TableStyle</code> to resulting table style. (This is from memory, or I would also show the exact code I'm using. If needed, I can add that to the question somewhere later today.) </p>
  
  <p>Nothing changes however. I suspect this has something to do with the <code>MappingName</code> on the <code>TableStyle</code> object; all examples I could find yesterday evening seem to be for databinding a <code>DataSet</code> to the <code>DataGrid</code> and setting <code>MappingName</code> to the correct table name in the <code>DataSet</code>. Otherwise, the table style will not do what you expect, which is the behavior I'm seeing.</p>
  
  <p>Question: am I looking in the correct place for a solution to my problem, and if so, what do I need to set <code>TableStyle.MappingName</code> to when binding to a <code>List&lt;T&gt;</code> to show properties of <code>T</code>...?</p>
  
  <p>(Tried to check for possible duplicates, but was unable to find exact matches. Please correct me if I turn out to be wrong there.)</p>