This question is locked. New answers and comments are not allowed.
Marcus Eddy
Top achievements
Rank 1
Marcus Eddy
asked on 27 Jan 2009, 05:31 AM
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.
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.
4 Answers, 1 is accepted
0
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.
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.
0
Ken
Top achievements
Rank 1
answered on 24 Mar 2009, 07:39 PM
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.
0
Hi Ken,
Please try the following code line before you add the data source:
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.
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.
0
Ken
Top achievements
Rank 1
answered on 25 Mar 2009, 07:57 PM
Thanks....that did the trick.