Pages

Thursday, November 4, 2010

Visual Studio 2008: Bug in code generator for DataGridView

There is a bug in the Visual Studio 2008 code generator for the DataGridView. If you add a column and set the Name value to "Name", it does it, but next time you compile you will get the following error and warning:


  • Error 1 Cannot implicitly convert type 'string' to 'System.Windows.Forms.DataGridViewTextBoxColumn'
  • Warning 2 'LccEditor.Form1.Name' hides inherited member 'System.Windows.Forms.Control.Name'. Use the new keyword if hiding was intended.




The solution? Name the column something else!

3 comments:

  1. Thankx for ur help

    ReplyDelete
  2. Thanx a lot :)
    it's So strange though................

    ReplyDelete
  3. Happens in C# 2010 as well. Thanks for solving an annoying bug for me.

    ReplyDelete