title: How to paint custom control on datagridviewcell?
body: <p>I want to host a custom control for <code>datagridviewcell</code>. </p>
  
  <p>the only good reference i have was <a href="http://msdn.microsoft.com/en-us/library/7tas5c80.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/7tas5c80.aspx</a></p>
  
  <p>However, i want the cell to display my own usercontrol instead on </p>
  
  <pre><code> public class CustomCell : DataGridViewTextBoxCell
   {   
       protected override void Paint(System.Drawing.Graphics graphics,
         System.Drawing.Rectangle clipBounds, System.Drawing.Rectangle cellBounds,
          int rowIndex, DataGridViewElementStates cellState, object value, object 
            formattedValue, string errorText, DataGridViewCellStyle cellStyle,
              DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts)
       {
            base.Paint(graphics, clipBounds, cellBounds, rowIndex, cellState, value, 
              formattedValue, errorText, cellStyle, advancedBorderStyle, paintParts);               
       }
   }
  </code></pre>
  
  <p>Can anyone guide me how to do it ?</p>