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

dynamic dropdown in dynamic columns

2 Answers 46 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chetan Pawar
Top achievements
Rank 1
Chetan Pawar asked on 23 Jun 2010, 06:48 AM
Hi all,

i am creating columns of the grid dynamically, i.e. the column names are not known before hand also the column type are not known.
when binding i check the column name of "[choice]" text and identify it as a dropdown column.
i want to bind a dropdown list to the column(s) programmitically (neither the editor providers nor the columns are defined in design)

can anyone out there help me out? please

thanks in advance

2 Answers, 1 is accepted

Sort by
0
Accepted
Pavlina
Telerik team
answered on 23 Jun 2010, 09:14 AM
Hello Chetan,

I suggest that you examine the help topic below and let me know if it helps to achieve your goal:
Customize/Configure GridDropDownColumng

Greetings,
Pavlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Chetan Pawar
Top achievements
Rank 1
answered on 23 Jun 2010, 09:31 AM
Hi,

thank you for your help

i made some changes and now i am able to display the dropdown list as i want it to be

if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
            {
                GridDataItem item = e.Item as GridDataItem;
                TableCell categoryCell = item["VisitorID"];
                categoryCell.Controls.Clear();
               
                DropDownList ddp = new DropDownList();
                ddp.Items.Insert(0, new ListItem("Select Contact Title", "NotSetItem"));
                categoryCell.Controls.Add(ddp);
            }

thanks once again
Tags
Grid
Asked by
Chetan Pawar
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Chetan Pawar
Top achievements
Rank 1
Share this question
or