<
telerik:GridTemplateColumn HeaderText="Job No" DataField="JOB_NO">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "JOB_NO")%>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadComboBox ID="cboJob" runat="server" Sort="Ascending" AppendDataBoundItems="true" EnableLoadOnDemand="true" Width="350px" Height="140px" DataValueField="JOB_NO" EmptyMessage="Select a Job" AutoPostBack="true" DataTextField="JOB_NO" MarkFirstMatch="true" AllowCustomText="false" DropDownWidth="300px"
OnItemDataBound="cboJob_ItemDataBound" HighlightTemplatedItems="true" >
<HeaderTemplate>
<table style="width:300px; text-align:left">
<tr>
<td style="width:100px;">Job No</td>
<td style="width:200px;">Part No</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<table style="width:300px; text-align:left">
<tr>
<td style="width:100px;"><%# DataBinder.Eval(Container.DataItem,"JOB_NO")%></td> <td style="width:300px;"><%# DataBinder.Eval(Container.DataItem,"JOBR_PART_NO")%></td>
</tr>
</table>
</ItemTemplate>
</telerik:RadComboBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>
//******In the C# code behind I have the following code in the ItemDataBound for the RadGrid:
if
(e.Item is GridEditFormItem && e.Item.IsInEditMode)
{
GridEditFormItem editFormItem = (GridEditFormItem)e.Item;
TextBox txt = (TextBox)editFormItem.FindControl("CUST_ID");
GridEditableItem edititem = e.Item as GridEditableItem;
RadComboBox combobox = (RadComboBox)edititem.FindControl("cboJob");
DataTable dt = cData.getDataTable("SELECT DISTINCT JOB_NO, JOBR_PART_NO FROM JOB_REVISION WHERE CUST_ID = '" + txt.Text.ToString() + "' ORDER BY JOB_NO", "JOB_REVISION");
combobox.DataSource= dt;
combobox.DataTextField =
"JOB_NO";
combobox.DataValueField =
"JOB_NO";
combobox.DataBind();
combobox.SelectedValue =
DataBinder.Eval(e.Item.DataItem, "JOB_NO").ToString();
//*******I also have the following code for the combo:
protected void cboJob_ItemDataBound(object sender, RadComboBoxItemEventArgs e)
{
e.Item.Text = ((D
ataRowView)e.Item.DataItem)["JOB_NO"].ToString();
e.Item.Value = ((
DataRowView)e.Item.DataItem)["JOB_NO"].ToString();
e.Item.DataBind();
}