This is a migrated thread and some comments may be shown as answers.

How To Display ComboBoxes in RadGridView

1 Answer 74 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Peter Skouhus
Top achievements
Rank 1
Peter Skouhus asked on 29 Jul 2009, 04:37 AM
Dear Telerik,

I am currently having problems displaying a ComboBox column in RadGridView.  The following is my code:

         
            GridViewCheckBoxColumn colIsSelected = new GridViewCheckBoxColumn("Select"); 
            GridViewLookUpColumn colProjectRoles = new GridViewLookUpColumn("RoleID"); 
            colProjectRoles.DropDownStyle = RadDropDownStyle.DropDownList; 
            colProjectRoles.DisplayMember = "Name"
            colProjectRoles.ValueMember = "ID"
            colProjectRoles.DataSource = General.ProjectRoles; 
 
            rgvUsers.Columns.Add(new GridViewDataColumn("UserID")); 
            rgvUsers.Columns.Add(colIsSelected); 
            rgvUsers.Columns.Add(colProjectRoles); 
            rgvUsers.Columns.Add(new GridViewDataColumn("CompanyName")); 
            rgvUsers.Columns.Add(new GridViewDataColumn("LastName")); 
            rgvUsers.Columns.Add(new GridViewDataColumn("FirstName")); 
 
            rgvUsers.Columns["RoleID"].HeaderText = Properties.Resources.AssignUser_ProjectRole; 
            rgvUsers.Columns["CompanyName"].HeaderText = Properties.Resources.AssignUser_CompanyName; 
            rgvUsers.Columns["LastName"].HeaderText = Properties.Resources.AssignUser_LastName; 
            rgvUsers.Columns["FirstName"].HeaderText = Properties.Resources.AssignUser_FirstName; 
 
            rgvUsers.Columns["Select"].ReadOnly = false
            rgvUsers.Columns["RoleID"].ReadOnly = false
            rgvUsers.Columns["CompanyName"].ReadOnly = true
            rgvUsers.Columns["LastName"].ReadOnly = true
            rgvUsers.Columns["FirstName"].ReadOnly = true
 
            rgvUsers.Columns["UserID"].IsVisible = false
 
            foreach (TLUser user in userList) 
            { 
                object[] values = { user.UserId, false, Guid.Empty, user.CompanyName, user.LastName, user.FirstName }; 
                rgvUsers.Rows.Add(values); 
            } 

1 Answer, 1 is accepted

Sort by
0
Boryana
Telerik team
answered on 29 Jul 2009, 02:56 PM
Hi Peter Skouhus,

Thank you for contacting us. I am not quite sure I understand exactly what is the issue, so excuse me if my answer does not answer your question. Even though I tried I could not reproduce the case when the ComboBox is not displayed. For that reason, I would like to ask to open a new Support Ticket and attach a sample project that demonstrates the issue.

Please, note that a reason for your issue, might be the fact that you are not using the latest version of our controls. That is why we highly recommend you upgrade to Q2 Service Pack 1 which is coming this week.
I would like to make also a few remarks in order to avoid any possible misunderstanding. Please, note that the ComboBox in the cell will be displayed only if RadGridView is in edit mode. Further, the Winforms RadGridView supports only one editor to be opened at a time. This implies that there can be only one combobox visible at a time. In your situation it is the default behavior of RadGridView that does not allow displaying all RadComboBoxes.

Please, let us know if the issue persists after upgrading. I am looking forward to your reply.

Greetings,
Boryana
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.
Tags
GridView
Asked by
Peter Skouhus
Top achievements
Rank 1
Answers by
Boryana
Telerik team
Share this question
or