multicolumncombobox auto generate columns

5 posts, 0 answers
  1. Marcus Eddy
    Marcus Eddy avatar
    26 posts
    Member since:
    Jun 2008

    Posted 26 Jan 2009 Link to this post

    Hi,

    I have a MultiColumnComboBox and I set (both in Property Builder) and in properties -> EditorControl -> MasterGridViewTemplate the columns to only have two against the bindingsource I have speficied, however all the columns are added at runtime.  I have manually changed the AutoGenerateColumns on the EditorControl -> MasterGridViewTemplate in code but still it auto generates the columns.

    Any help appreciated.
  2. Nick
    Admin
    Nick avatar
    767 posts

    Posted 29 Jan 2009 Link to this post

    Hello Marcus Eddy,

    Thank you for your question. There is generated code in the designer (e.g. Form1.Designer.cs) that adds the columns - you need to remove or comment this code in order to get your case to work. Do not hesitate to write me back if you have more questions.

    Greetings,
    Nick
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Ken
    Ken avatar
    4 posts
    Member since:
    Aug 2008

    Posted 24 Mar 2009 Link to this post

    This solution seems unweildy and hacky.  I'm dealing with tables that have 20+ columns and I need to display only two.  (And won't the designer code be overriden if I touch the control again in Design time?)  What if I am initializing Multicolumncombobox.Datasource to a BindingSource with no DataSource set at design time, and then set BindingSource.Datasource at runtime?  Is there is there just a way to make it not autogenerate these columns when BindingSource.Datasource is set at runtime?  Seems easier if I can just manually define the two columns I need, then set BindingSource.Datasource and have it cooperate (ie.  not create all the auto columns).  

    Thanks.
  5. Nick
    Admin
    Nick avatar
    767 posts

    Posted 25 Mar 2009 Link to this post

    Hi Ken,

    Please try the following code line before you add the data source:

     ((RadGridView)this.radMultiColumnComboBox1.EditorControl).MasterGridViewTemplate.AutoGenerateColumns = false

    Since you are adding the data source at run time, the above should work, but if this does not help, please open a new support ticket and send us a sample project which we can test locally.
     

    All the best,
    Nick
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  6. Ken
    Ken avatar
    4 posts
    Member since:
    Aug 2008

    Posted 25 Mar 2009 Link to this post

    Thanks....that did the trick.
Back to Top
UI for WinForms is Visual Studio 2017 Ready