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

Bind RadComboBox to Linq

1 Answer 102 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Bernhard Rosenfelder
Top achievements
Rank 1
Bernhard Rosenfelder asked on 28 Dec 2011, 09:05 PM
Hi Telerik community, does someone know how to bind RadComboBox to linq with codebehind when the radcombobox is within grid editform? Thanks, Bernhard

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 29 Dec 2011, 05:50 AM
Hello Bernhard,

Try the following code.
C#:
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
  if (e.Item is GridEditableItem && e.Item.IsInEditMode)
  {
     GridEditableItem item = (GridEditableItem)e.Item;
     RadComboBox combo = (RadComboBox)item.FindControl("RadComboBox1");
     combo.DataSourceID = "LinqDataSource1";//bind the combobox
  }
}

-Shinu.
Tags
ComboBox
Asked by
Bernhard Rosenfelder
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or