locked
DataGridView - Problems with adding columns at design time RRS feed

  • Question

  • Hi,

    I recently started to use Visual Studio 2010 and found some problems with the DataGridView control. I think one of them could be a bug. Here is the steps how to reproduce it. (Using C#)

    1) Create a new Windows Form Application

    2) Drag a DataGridView control to the default form "Form1"

    3) Find the "Columns" property on the "Properties" window

    4) Click the little icon (looks like [...]) to the right of the "Columns" property, to bring up the "Edit Column" window

    5) Add couple of columns through the "Add..." button on the "Edit Column" window.

    6) Press "OK" to save the changes and close the "Edit Column" window.

    7) Remove the DataGridView control from the form.

    8) Drag and drop another DataGridView control

    9) Follow the above steps 3) & 4) to add columns.

    10) You will find the "Add..." button on the "Edit Column" does NOT work now. It doesn't bring up the "Add Column" window, but close the "Edit Column" window instead. (Note, the little arrow button on the top-right corner of the DataGridView control still works)

    Not sure if everyone else has the same problem, but it reproducable on my computer.

    Other problems I got:

    a) Sometimes when I change the properties of the columns in the DataGridView control, all the columns will disappear!

    b) If I name one of the column to "column1" (any name), and delete this column (or delete the whole DataGridView), I cannot use that name again. I always get "'column1' is not a valid identifier" error. I am pretty sure it is a valid name, as I searched the whole solution and didn't find any duplicates.

    Thanks!

    Leo

    Friday, June 29, 2012 4:16 PM