Home Forums WinForms controls Other WinForms controls WinComboBox – Hide columns in Code

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #18303 |

    I have several comboboxes which I do not want to show all columns returned from the dataset. These controls are bound in code from an existing dataset. I need all the values at some time, therefore limiting the stored procedure is not an option. Any help is appriciated

    Imported from legacy forums. Posted by Ooh (had 2337 views)

    User (Old forums)
    Member
    Post count: 23064

    First, you can set the DisplayFormat property to only the columns you want to display in the TextBoxArea. Second, you can set each Column Visible property in the Columns collections, so only columns you want will display in the Dropdown control.

    e.g.:

    winComboBox1.DisplayFormat = “%CompanyName%”;
    winComboBox1.Columns[ “CompanyID” ].Visible = false;

    Imported from legacy forums. Posted by André (had 3441 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.