How to set up MultiComboBoxColumn?

19 posts, 0 answers
  1. Daniel
    Daniel avatar
    91 posts
    Member since:
    Jan 2008

    Posted 11 Feb 2009 Link to this post

    Hi,

    I have MutliComboBoxColumn in grids and I need to adjust widths of this combo columns (displayed when I drop down combo). I failed to find any way how to do this from designer or code. Is there any way how to alter columns of this in-grid combo? Thx

    Daniel
  2. Nick
    Admin
    Nick avatar
    767 posts

    Posted 12 Feb 2009 Link to this post

    Hi Daniel,

    Thank you for your question. Please use the following code:

    private void Form1_Load(object sender, EventArgs e) 
               
      ((RadGridView)multiComboBox.EditorControl).Columns["columnName"].Width = 170; 

    Do not hesitate to write me back if you have further questions.

    Regards,
    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. Daniel
    Daniel avatar
    91 posts
    Member since:
    Jan 2008

    Posted 12 Feb 2009 Link to this post

    Hi Nick,

    what you posted applies to RadMultiColumnComboBox control, not GridViewMultiComboBoxColumn, which is multicolumn combo in grid. Is there any way how to achieve something similar with GridViewMultiComboBoxColumn? Thx

    Regards,
    Daniel
  5. Nick
    Admin
    Nick avatar
    767 posts

    Posted 16 Feb 2009 Link to this post

    Hello Daniel,

    Thank you for your question. Please use the following work-around:

     
            private void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e) 
            { 
                if (this.radGridView1.ActiveEditor is RadMultiColumnComboBoxElement) 
                { 
                    ((RadGridView)((RadMultiColumnComboBoxElement)this.radGridView1.ActiveEditor).EditorControl).Columns[0].Width = 200; 
                } 
            } 

    Do not hesitate to write me back if you have further questions.

    Kind regards,
    Nick
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. Daniel
    Daniel avatar
    91 posts
    Member since:
    Jan 2008

    Posted 16 Feb 2009 Link to this post

    Hi Nick,

    thanks for the answer. This is however not very nice solution when you need to set column widths and other parameters, which can be set once, then reused. This way it'll have to be done every time column/cell is being edited.

    I think it'd be appropriate to have such ability to set up multi-column combo column's drop down properties (columns, widths, headers, etc.) in design time via designer.

    Cheers,
    Daniel
  7. Nick
    Admin
    Nick avatar
    767 posts

    Posted 16 Feb 2009 Link to this post

    Hi Daniel,

    Thank you for your feedback. I have updated your Telerik points. We are going to add design time support soon.

    Greetings,
    Nick
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  8. Khanh Son
    Khanh Son avatar
    2 posts
    Member since:
    Apr 2009

    Posted 26 May 2009 Link to this post

    Hi,

    I have MultiComboBoxColumn in the grid. This column is binded to datasource already.
    I face 2 issues and hope anybody would help me to figure it out.

    Issue #1: can not add a column into grid-combo MultiComboBoxColumn.
    I could use RadMultiColumnComboBoxElement to interact with grid-combo(for example, iterating the columns inside MultiComboBoxColumn) as I did with RadMultiColumnComboBox. But unlike MultiColumnComboBox, I can not add a new column using RadMultiColumnComboBoxElement.
    I try to handle with CellBeginEdit event (RadGridView) but it throw exception ("A column with the same Name already exists in the collection") at second-click row.

    Issue #2: can not "add new row" into grid-combo of MultiComboBoxColumn.
    I also use RadMultiColumnComboBoxElement as Issue #1, but AddNewRow does not working.
    Pls take a look at code below:
    void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e) 
            { 
                if (radGridView1.ActiveEditor is RadMultiColumnComboBoxElement) 
                { 
                    RadMultiColumnComboBoxElement multiComboBoxElement = (RadMultiColumnComboBoxElement)radGridView1.ActiveEditor; 
     
                    multiComboBoxElement.EditorControl.MasterGridViewTemplate.AllowAddNewRow = true
                    multiComboBoxElement.EditorControl.MasterGridViewTemplate.AddNewRowPosition = PinnedRowPosition.Top; 
                    multiComboBoxElement.EditorControl.MasterGridViewTemplate.BestFitColumns(); 
     
                    GridViewDataColumn colDetails = new GridViewDataColumn(); 
                    colDetails.UniqueName = "Details"
                    colDetails.HeaderText = "Details"
                    colDetails.DataType = typeof(string); 
     
                    multiComboBoxElement.Columns.Add(colDetails); 
                } 
            } 


    I use Q3 2008 version. Pls give me a suggestion how to fix it.

    Thanks
    SonTK



  9. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 29 May 2009 Link to this post

    Hello Khanh Son,

    Thank you for writing.

    Because of the reuse of editors in RadGridView, you have to check if the new column is a non existing before trying to add it. Otherwise, you are trying to add it every time when CellBeginEdit fires. Also I have tested AddNew method with Q3 2008 and it works as expected. You have to keep in mind that it adds a blank row and you have to manually populate it with data after that. Please, review the code-block below:

    void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)  
    {  
        if (radGridView1.ActiveEditor is RadMultiColumnComboBoxElement)  
        {  
            RadMultiColumnComboBoxElement multiComboBoxElement = (RadMultiColumnComboBoxElement)radGridView1.ActiveEditor;  
     
            multiComboBoxElement.EditorControl.MasterGridViewTemplate.AllowAddNewRow = true;  
            multiComboBoxElement.EditorControl.MasterGridViewTemplate.AddNewRowPosition = PinnedRowPosition.Top;  
            multiComboBoxElement.EditorControl.MasterGridViewTemplate.BestFitColumns();  
     
            if (multiComboBoxElement.Columns.Count < 3) //check if the column has not already been added  
            {  
                GridViewDataColumn colDetails = new GridViewDataColumn();  
                colDetails.UniqueName = "Details";  
                colDetails.HeaderText = "Details";  
                colDetails.DataType = typeof(string);  
     
                multiComboBoxElement.Columns.Add(colDetails);  
            }  
     
            GridViewDataRowInfo row = multiComboBoxElement.Rows.AddNew();  
            row.Cells["Details"].Value = "Some details";  
        }  

    I hope this helps. Do not hesitate to contact me again if you have other questions.

    Regards,
    Martin Vasilev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  10. Khanh Son
    Khanh Son avatar
    2 posts
    Member since:
    Apr 2009

    Posted 02 Jun 2009 Link to this post

    Hello Martin,

    Before receiving your solution, I solved the issue "Add Details column" by adding a member into object which List<object> is used as Datasource.

    I try with your solution and it worked as well.
    Thanks you so much and thanks Telerik.

    Regards,
    Khanh Son

  11. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 04 Jun 2009 Link to this post

    Hello Khanh Son,

    Thank you for getting back to me. I am glad that the suggested approach suits your scenario. Actually, adding the column in the DataSource is another way as well. Write me back if you need additional assistance.

    All the best,
    Martin Vasilev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  12. Ajay
    Ajay avatar
    2 posts
    Member since:
    Jul 2007

    Posted 16 Dec 2009 Link to this post

    Hi
    Team Telerik

    i am using the telerik version "2009.1.9.414" , I am using multicoloum combobox in grid .
    I am facing issues :
    1) When i click the cell with previously assigned value, the multicoloum combobox gets in edit mode but the assigned value get lost and value gets blank.
    2) how to achieve the suggest append functionality in this, similar to normal combo.

    Thanks
    Ajay Yadav


  13. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 18 Dec 2009 Link to this post

    Hello Sharma,

    Thank you for contacting us. Please, upgrade to the latest version - Q3 2009 SP1. It contains numerous bug fixes and improvements and it is possible the described behavior to be improved. If you still experience any difficulties, please open a new support ticket and send us a small sample project that demonstrates your scenario. This will help us investigate your case further and provide accurate assistance.

    Sincerely yours, Martin Vasilev
    the Telerik team

     


    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  14. Alain
    Alain avatar
    13 posts
    Member since:
    Mar 2011

    Posted 10 Apr 2011 Link to this post

    Hi All,


    I'm currently using WINFORM Q1 2011 and trying to set the Headertext and Width of the individual columns programmatically (VB.net) in a GridViewMultiComboBoxColumn but failed to find any satisfactory answer in the help file and above, This is basically the same as the original question posted by Daniel and to which Nick replied: "We are going to add design time support soon.". I wondered whether this is now possible in the Q1 2011 version.


    Best regards,
    Alain Cavenaile
  15. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 11 Apr 2011 Link to this post

    Hello,

    You can reach the RadGridView section of the RadMultiColumnComboBox via "Open Property Builder" from the Smart Tag, or via code using
    this.radMultiColumnComboBox1.EditorControl
    where EditControl is the RadGridView.

    Hope that helps
    Richard
  16. Ira
    Ira avatar
    4 posts
    Member since:
    Oct 2013

    Posted 13 Dec 2013 Link to this post

    I'm wondering what the status of this might be (design time support for configuring columns of a GridViewMultiComboBoxColumn).  I'm using 2013 Q3 and it still seems to be absent.

    I am currently converting a project that previously used the Infragistics winform UltraWinGrid.  The Infragistics grid has had design-time support for this sort of thing for well over ten years now.

  17. Dess
    Admin
    Dess avatar
    1601 posts

    Posted 18 Dec 2013 Link to this post

    Hello Ira,

    Thank you for contacting Telerik Support.

    GridViewMultiComboBoxColumn provides design time support for the most important grid properties including the DataSource property which populates the internal grid with the specified data collection. Unbound mode for the EditorControl at design time is not supported due to the specific nature of the grid editors, which get reused for performance reasons. The CellEditorInitialized event is the appropriate place to set up the desired columns for the editor in unbound mode.

    I hope this information helps. Should you have further questions, I would be glad to help.

    Regards,
    Desislava
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  18. Peter
    Peter avatar
    4 posts
    Member since:
    Jun 2013

    Posted 13 Feb 2014 Link to this post

    I am also using 2013 Q3 and I find it impossible to configure the GridVieMulitComboBoxColumn.  Why Telerik saw it fit to make this task so immensely obscure is completely beyond me.

    I have a GridVieMulitComboBoxColumn in a GridView bound to a SQL Server View.  The first column is an ID column, so I wish to hide that but use it later to identify the selection the user has made.  As far as I can tell, it is impossible to configure the columns of this combobox at design time. You cannot hide columns, change column headers, set column width format columns, such as currency, etc. Unless I am missing a major point here, this version is therefore not any better than the one complained about in 2009 already in this thread.

    If possible, kindly provide guidance on how to configure this unfathomable control at design time (or at run time, for that matter).

    Thanks very much.

  19. Dess
    Admin
    Dess avatar
    1601 posts

    Posted 18 Feb 2014 Link to this post

    Hello Peter,

    Thank you for contacting us.

    Due to the UI virtualization in RadGridView, editors are being reused. That is why due to the specificity of the editing mechanism, design time support for the GridViewMultiComboBoxColumn editor's columns is not supported. However, you are allowed to change HeaderText or Visibility for the certain column in the popup grid via the CellEditorInitialized event:
    private void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
    {
        if (e.Column is GridViewMultiComboBoxColumn)
        {
            RadMultiColumnComboBoxElement editor = e.ActiveEditor as RadMultiColumnComboBoxElement;
            
            editor.EditorControl.Columns["OrderID"].IsVisible = false;
            editor.EditorControl.Columns["OrderDate"].HeaderText = "Custom text";
        }
    }

    You can find useful information in our RadGridView online help documentation - section Editors.

    I hope this information helps. Should you have further questions, I would be glad to help.

    Regards,
    Desislava
    Telerik
  20. Peter
    Peter avatar
    4 posts
    Member since:
    Jun 2013

    Posted 18 Feb 2014 in reply to Dess Link to this post

    Brilliant!! And so easy once you know how.

     

    Thanks very much, it all makes so much more sense now. You guys at Telerik are the best, and WAY ahead of everyone else! 

    Best wishes,

    Peter

Back to Top
UI for WinForms is Visual Studio 2017 Ready