or
RadComboBox oops = new RadComboBox();oops.ID = "cboAccount";Response.Write("<script language='javascript'>alert('" + Server.HtmlEncode(oops.SelectedValue) + "')</script>");var lstEmployees = employeeRepository.All.Select(employee => new { employee.Id, employee.Name });
txtEmployee.DataSource = lstEmployees.ToList();
txtEmployee.DataTextField = "Name";
txtEmployee.DataValueField = "Id";
txtEmployee.DataBind();
This code is called in the Page_Load() event inside the
if (!IsPostBack) block.
This triggers the error "The Control DataSource or (DataSourceID) is not set" when I start typing into it.
What I noticed is, when I move the binding code outside the if (!IsPostBack) block, it works correctly.

protected void RadGrid1_ExcelMLExportStylesCreated(object source, GridExportExcelMLStyleCreatedArgs e) { StyleElement dateStyle = new StyleElement("Date"); dateStyle.NumberFormat.FormatType = NumberFormatType.Fixed; dateStyle.NumberFormat.Attributes["ss:Format"] = "d"; e.Styles.Add(dateStyle); } }<telerik:RadGrid SkinID="myTemplate" ID="myGrid" runat="server" DataSourceID="myDataSourceID" OnInsertCommand="OnInserting" OnUpdateCommand="OnUpdating"> <MasterTableView DataKeyNames="myDataKey"> <CommandItemSettings AddNewRecordText="Assign Location" /> <EditFormSettings CaptionFormatString="Edit Location" InsertCaption="Add New Location" EditFormType="Template"> <FormTemplate> <!-- Begin Edit Item Table Template --> <table id="Table10"> <tr> <td> <des:LocalizableLabel ID="Location" runat="server" Text="Location"></des:LocalizableLabel> </td> <td> <aec:TelerikAutoCompleteBox ID="locationsAutoComplete" runat="server" DataSourceID="sqlLocationAutocomplete" DataTextField="Name" DataValueField="Location_ID" Filter="Contains" TextSettings-SelectionMode="Single" InputType="Text"> </aec:TelerikAutoCompleteBox> </td> </tr> <tr> <td> <des:LocalizableLabel ID="StorageLocation" runat="server" Text="Storage Location"></des:LocalizableLabel> </td> <td> <aec:TelerikDropDown runat="server" DataField="Storage_Location" DataTextField="Storage_Location" DataValueField="Storage_Location" DataSourceID="sqlStorageLocation" ID="storageLocationDropDown"> </aec:TelerikDropDown> <asp:CustomValidator runat="server" ID="customValidator1" ClientValidationFunction="EquipmentLocation_ClientValidate" OnServerValidate="validateLocation" ControlToValidate="storageLocationDropDown" ErrorMessage="Must select either Location or Storage Location." Display="static"> </asp:CustomValidator> </td> </tr> </table> <AERadGrid:EditFormSaveCancelButtons ID="locationAssignEditFormButtons" runat="Server"> </AERadGrid:EditFormSaveCancelButtons> <!-- End Edit Item Table Template --> </FormTemplate> </EditFormSettings> <Columns> <telerik:GridBoundColumn UniqueName="Location_Name" HeaderText="Location" DataField="Location_Name"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="Storage_Location" HeaderText="Storage Location" DataField="Storage_Location"> </telerik:GridBoundColumn> </Columns> </MasterTableView></telerik:RadGrid>function EquipmentLocation_ClientValidate(source, args) { //get a reference to the calling validator control var CustomValidator1 = source.id; /* get the values of the location auto complete and the storage location ddl and compare.*/ var storageLocation = args.Value; var location = ?? //GET the value out of the autocomplete box....how? }