Adding RadCheckedDropDownList to RadGridView

1 Answer 87 Views
CheckedDropDownList
R.D. Henry and Co.
Top achievements
Rank 2
Iron
Iron
Iron
R.D. Henry and Co. asked on 05 Jun 2023, 04:28 PM

I'm using Winforms and need a raddatagrid to show a person's name and what accounts they can view.

Name is from one datasource and Accounts will be from another.  The Accounts will be in the RadCheckedDropDownList.

Following this example, I was able to add just the Accounts to the grid.  I cannot figure out how to add the Name column.

Any help would be appreciated.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Accepted
Dinko | Tech Support Engineer
Telerik team
answered on 06 Jun 2023, 10:54 AM

Hello Curtis,

If you want to add an additional column you can create a similar column like the GridViewTextBoxColumn and set the FieldName property to point to a property from your object. For your convenience, I have created a sample project to demonstrate what I have in mind.

GridViewTextBoxColumn nameColumn = new GridViewTextBoxColumn();
nameColumn.FieldName = "Name";           

GridViewTextBoxColumn checkedDropDownListColumn = new GridViewTextBoxColumn();
checkedDropDownListColumn.FieldName = "CurrentParts";
checkedDropDownListColumn.Width = 200;

this.radGridView1.Columns.Add(nameColumn);
this.radGridView1.Columns.Add(checkedDropDownListColumn);

Here is the result when I run the project.

Regards,
Dinko | Tech Support Engineer
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

R.D. Henry and Co.
Top achievements
Rank 2
Iron
Iron
Iron
commented on 06 Jun 2023, 04:08 PM

I ran your code and got the same results as I did when trying to add the Name column to my code.  The Name column turned out to be the multiple select instead of the CurrentParts column.

 

R.D. Henry and Co.
Top achievements
Rank 2
Iron
Iron
Iron
commented on 06 Jun 2023, 04:39 PM

Oops, I see the issue.  Change the CurrentColumn.Index from == 0 to == 1.

        void radGridView1_EditorRequired(object sender, EditorRequiredEventArgs e)
        {
            if (this.radGridView1.CurrentColumn.Index == 1)
            {
                RadCheckedDropDownListElement editor = new GridViewCheckedDropDownListEditor();
                editor.DataSource = this.columnData;
                editor.DisplayMember = "CurrentParts";
                e.Editor = editor;
            }
        }

R.D. Henry and Co.
Top achievements
Rank 2
Iron
Iron
Iron
commented on 06 Jun 2023, 04:45 PM

Thanks. 
Tags
CheckedDropDownList
Asked by
R.D. Henry and Co.
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or