title: c# datagridview in tab control not drawing changes after first switch to tab
body: <p>The setup:
  I have a tab control and a datagridview (under the tabpageindex==2).</p>
  
  <p>the datagridview is bound to a datatable.</p>
  
  <p>In the tab control's tab_Selected event, if tabpageindex==2, I change some colors in some cells in the datagridview.</p>
  
  <p>The problem:
  The first time I select the tab with the datagridview in the application, the cells do not change color (i.e. the bound data is displayed, but my changing of colors does not work).</p>
  
  <p>If I then click into another tab and back to this tab, then the colors appear.</p>
  
  <p>Question:
  Any idea why this is?
  Should I be doing this differently, i.e. not in the tab_selected event?
  (what I basically need is that certain cells have certain formats/colors depending on the data in the cells. I also e.g. call this drawing of cells function after the datagridview is sorted and there it works. just the first tab_selected event does not color...)</p>
  
  <p>thanks for any help,
  imran</p>