<form id="form1" runat="server" method="post"> <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> </telerik:RadScriptManager> <div> <telerik:RadComboBox ID="rcbResource" runat="server" Height="200px" Width="230px" AutoPostBack="true" DropDownWidth="500px" EmptyMessage="Search a Text" HighlightTemplatedItems="true" EnableLoadOnDemand="true" Filter="Contains" OnItemsRequested="rcbResource_ItemsRequested" OnSelectedIndexChanged="rcbResource_SelectedIndexChanged" MarkFirstMatch="true" EnablePostBackOnRowClick="true" > <HeaderTemplate> <table cellspacing="0" cellpadding="0"> <tr> <td style="font-size: 12px; width: 150px; word-wrap: break-word;"> Key </td> <td style="font-size: 12px; padding-left: 10px"> Text </td> </tr> </table> </HeaderTemplate> <ItemTemplate> <table width="100%" cellspacing="0" cellpadding="0" style="border: 1px solid grey"> <tr> <td class="menuoff" onmouseover="className='menuon';" onmouseout="className='menuoff';"> <%# DataBinder.Eval(Container, "Text")%> </td> <td style="text-align: left;"> <%# DataBinder.Eval(Container, "Attributes['Text']")%> </td> </tr> </table> </ItemTemplate> </telerik:RadComboBox> </div> </form>
C# ASP.NET
protected void rcbResource_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e) { if (e.Text != "") { var SearchList = DataManager.SearchResourceText(e.Text.Trim()); foreach (var resource in SearchList) { RadComboBoxItem item = new RadComboBoxItem(); //set the key item.Text = resource.mkFieldId; item.Value = resource.mkDictionaryId.ToString(); string text = resource.Text; item.Attributes.Add("Text", text); rcbResource.Items.Add(item); item.DataBind(); } } else { RadComboBoxItem item = new RadComboBoxItem(); item.Text = "No Key Found"; item.Value = "1"; string text = "Enter a text"; item.Attributes.Add("Text", text); rcbResource.Items.Add(item); item.DataBind(); } } protected void rcbResource_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e) { if (lstResourceIds.Items.FindByText(e.Text) != null) { lstResourceIds.SelectedValue = lstResourceIds.Items.FindByText(e.Text).Value; rcbResource.Text = ""; } }
please advise if im missing something.
regards
Shaz
<telerik:RadComboBox ID="employeeList" runat="server" Height="200px" Width="300px" DropDownWidth="300px" HighlightTemplatedItems="true" CausesValidation="false" EnableLoadOnDemand="true" EmptyMessage="Choose and Employee" Filter="StartsWith" AutoPostBack="true" onitemsrequested="employeeList_ItemsRequested" onselectedindexchanged="employeeList_SelectedIndexChanged"> <HeaderTemplate> <table> <tr> <td style="width: 150px;"> Employee Name </td> <td style="width: 200px;"> Employee UserName </td> </tr> </table> </HeaderTemplate> <ItemTemplate> <table style="width: 300px" cellspacing="0" cellpadding="0"> <tr> <td style="width: 150px"> <%# DataBinder.Eval(Container, "Attributes['Name']") %> </td> <td style="width: 150px"> <%# DataBinder.Eval(Container, "Attributes['ID']") %> </td> </tr> </table> </ItemTemplate> </telerik:RadComboBox>
protected void employeeList_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
{
SqlConnection connection = new SqlConnection(GetConnectionString());
connection.Open();
SqlCommand cmd = new SqlCommand();
//DataTable dt = new DataTable();
cmd = new SqlCommand("DisplayEmployeeNamesForDropDown", connection);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new SqlParameter("@ManagerID", TimeSlayer.ActiveDirectoryUser.UserName(User)));
//SqlDataAdapter da = new SqlDataAdapter(cmd);
//da.Fill(dt);
SqlDataReader dr;
dr = cmd.ExecuteReader();
//populate combo box for goal review form
//foreach (DataRow row in dt.Rows)
//{
// employeeComboBox.Items.Add(new RadComboBoxItem(row[1].ToString(), row[0].ToString()));
//}
foreach (IDataRecord record in dr)
{
RadComboBoxItem item = new RadComboBoxItem();
//item.Text =
//item.Value = record["Name"].ToString();
item.Attributes.Add("ID", record["ID"].ToString());
item.Attributes.Add("Name", record["Name"].ToString());
employeeList.Items.Add(item);
item.DataBind();
}
cmd.Connection.Close();
cmd.Connection.Dispose();
}
<td valign="top"><telerik:RadAjaxManager ID="radAjaxManager" runat="server"><AjaxSettings><telerik:AjaxSetting> <UpdatedControls><telerik:AjaxUpdatedControl ControlID="radAjaxPanel" LoadingPanelID="radAjaxLoadingPanel" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <telerik:RadAjaxLoadingPanel ID="radAjaxLoadingPanel" runat="server"> </telerik:RadAjaxLoadingPanel> <telerik:RadAjaxPanel ID="radAjaxPanel" runat="server" LoadingPanelID="radAjaxLoadingPanel"> <telerik:RadGrid ID="gvMyTransactions" runat="server" Width="100%" OnColumnCreating="GridViewColumnCreating" OnItemCommand="GridViewItemCommand" OnItemCreated="GridViewItemCreated" OnPageIndexChanged="GridViewPageIndexChanged" OnNeedDataSource="GridViewNeedDataSource" OnSortCommand="GridViewSortCommand" OnItemDataBound="GridViewItemDataBound"> <MasterTableView CellSpacing="0" CellPadding="0"><Columns> .....
Hi,
I was able to compile the code and deploy in windows xp without any problem but when I compiled in Win 7 Enterprise and deployed on to IIS server it gave the server error saying it cannot load type 'Telerik.Web.UI.DialogHandler'.
can you please explain whether this error is due to Windows 7 introducing new http module tag <add name="RadCompression" type="Telerik.Web.UI.RadCompression"/> in web.config or not?
Please find the web.config error after deployment in production server , as of now I have rolled back all the \bin\compiled items. Please help me out. Do I have to copy the app. Telerik DLL in bin folder or register it in Global assembly cache (GAC) using GACUtil.exe in prod IIS server.
Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Could not load type 'Telerik.Web.UI.DialogHandler'.
Source Error:
Line 110: <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
Line 111: <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
Line 112: <add verb="*" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler"/>
Line 113: <add verb="*" validate="false" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler, Telerik.Web.UI"/>
Line 114: <add verb="*" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.Upload.RadUploadProgressHandler, Telerik.Web.UI" />
Source File: D:\inetpub\azcollectorsguide\web.config Line: 112
Version Information: Microsoft .NET Framework Version:2.0.50727.3623; ASP.NET Version:2.0.50727.3618