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

[Solved] How to populate GridDropDownColumn by IList<Item>

1 Answer 221 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Virendra
Top achievements
Rank 1
Virendra asked on 01 Sep 2009, 10:50 AM
Hi,
I have RadGrid with one GridDropDownColumn, I want to populate this coulmn by a IList<Item> where item is
 

public

 

class Item

 

 

{

 

public string ItemData { get; set; }

 

public string ItemDescription { get; set; }

 

 

}

 

 

On myGridLoad()
I am populating IList<iTem>

 

DataGridComboBoxColumn 

 

dataGridComboBoxColumn = new DataGridComboBoxColumn();

 

 

IList<Item> DropDownList = new List<Item>();

 

for (int idx = 0; idx < 10; ++idx)

 

{

 

 

Item item = new Item();

item.ItemData = dropdownList[idx];

item.ItemDescription = dropdownList[++idx];

DropDownList.Add(item);

}

dataGridComboBoxColumn.ListValueField =

"ItemData";

 

 

dataGridComboBoxColumn.ListTextField =

"ItemDescription";

 

 

 

//how to assign this IList<item> to the ComboBoxColumn
//dataGridComboBoxColumn.DataSourceID = DropDownList;

}

 

 

 

 
Please let me know how to handle this.

thanks
virendra kumar

 

 

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Mira
Telerik team
answered on 03 Sep 2009, 03:32 PM
Hi Virendra,

I recommend that you populate the GridDropDownColumn as shown in the Customize/Configure GridDropDownColumn help topic. To see how to bind it in the code behind, please take a look at this forum topic.

Greetings,
Mira
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.
Tags
Grid
Asked by
Virendra
Top achievements
Rank 1
Answers by
Mira
Telerik team
Share this question
or