SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

WinForms Designer: DataGridView column type causes naming confusion

Last post 02-24-2016 11:29 AM by Juergen Thomas. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 02-24-2016 11:29 AM

    WinForms Designer: DataGridView column type causes naming confusion

    Situation: I put a DataGridView on the form, add a DataTable and start the column editor. By default, most columns are created as TextBoxColumn and are named in this way. If the table contains a field "refID" as reference to another table by ForeignKey, the column is registered in the Designer.cs as follows:

    private System.Windows.Forms.DataGridViewTextBoxColumn refIDDataGridViewTextBoxColumn;

    Now I reopen the column editor and change the ColumnType to ComboBoxColumn and register the added items (esp. DisplayMember and ValueMember). After closing the column editor, the column is registered in the Designer.cs as follows:

    private System.Windows.Forms.DataGridViewComboBoxColumn refIDDataGridViewTextBoxColumn;

    Oops, each property is set to the ComboBox' conditions but the internal name isn't changed. That's no problem because everything works as desired. But it's very confusing if I look for a specific ComboBox in order to change a property by code.

    Note: This hint maybe a supplement to my posts http://community.sharpdevelop.net/forums/t/22470.aspx (bug report) and  http://community.sharpdevelop.net/forums/t/22471.aspx (feature request).

    If the #D developers are in boredom, they could look for a solution of this minor problem. Juergen

    Filed under: ,
Page 1 of 1 (1 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.