...
public event EventHandler click;
public void RaisePostBackEvent(string eventArgument)
{
click1(this, EventArgs.Empty);
}
public virtual void click1(object sender, EventArgs e) {
if (click != null)
click(this, e);
}
private readonly RadComboBox radCombo = new RadComboBox
{
EnableVirtualScrolling = true,
EnableLoadOnDemand = true,
MaxHeight = 300,
Width = Unit.Percentage(100),
ShowMoreResultsBox = true,
ItemsPerRequest = 25,
OnClientItemsRequesting = "comboSetContext",
AutoPostBack = true
};
protected override void CreateChildControls()
{
radCombo.ID = ID + "_cb";
radCombo.ExpandAnimation.Duration = 200;
radCombo.CollapseAnimation.Duration = 200;
radCombo.WebServiceSettings.Path = "/combo.ashx";
radCombo.WebServiceSettings.UseHttpGet = true;
radCombo.WebServiceSettings.Method = ComboHandler;
radCombo.OnClientItemDataBound = "catComboItemDataBound";
radCombo.ToolTip = ToolTip;
if (string.IsNullOrEmpty(ComboHandler))
{
throw new Exception("Must specify a ComboHandler for CatComboBox " + ID);
}
Controls.Add(radCombo);
Controls.Add(new ScriptBlock { Script = "$('#" + ClientID + "_cb_Input').keydown(comboEnterPressed);" });
}
We have telerik license of version 2009.3.1314.35.
At one page, we have used radcombobox with ondemand rendering as below,
<telerik:RadComboBox ID="ddlEmployee" runat="server" Width="250px" Height="100px"
EmptyMessage="Select employee " EnableLoadOnDemand="True" EnableVirtualScrolling="true"
OnItemsRequested="RadComboBox1_ItemsRequested" DataTextField="Name" DataValueField="EmpNo"
Skin="WindowsXP" OffsetX="2" AllowCustomText="True" EnableEmbeddedSkins="False"
EnableAjaxSkinRendering="False" EnableEmbeddedBaseStylesheet="False" EnableItemCaching="True"
ShowMoreResultsBox="True">
</telerik:RadComboBox>
My requirement is to enable on demand functionality for employee list. The objective is, at page load I should be able to set selectedvalue item to employee combbox and also to achieve on demand functionality in it
The above scenario works fine if I dont set selectedvalue item to combobox in page load.
My observation while debugging.
The problem with RadCombobox is that if we bind the RadCombobox on page load, and try to click in combobox text area RadComboBox1_ItemsRequested is not get fired. However, if start writing something in RadCombobox text area RadComboBox1_ItemsRequested is get fired.
Please help us to achieve this functionality in combobox.
Thanks in advance.

<telerik:RadGrid ID="ClaimFormPartsGrid" runat="server" GridLines="None" Skin="Simple" AutoGenerateColumns="False" AllowSorting="False" AllowMultiRowSelection="False"> <MasterTableView EditMode="PopUp" CommandItemDisplay="Top" InsertItemDisplay="Top" CommandItemSettings-ShowRefreshButton="False" CommandItemSettings-ShowAddNewRecordButton="True" AutoGenerateColumns="False" EnableViewState="True" DataKeyNames="key"> <Columns> <telerik:GridEditCommandColumn UniqueName="EditCommand"/> <telerik:GridBoundColumn UniqueName="key" DataField="key" HeaderText="Name"/> <telerik:GridBoundColumn UniqueName="value" DataField="value" HeaderText="Value"/> <telerik:GridButtonColumn UniqueName="DeleteCommand" Text="Delete" CommandName="DeleteCommand" /> </Columns> <EditFormSettings EditFormType="Template" InsertCaption="Adding new Claim Form Part" CaptionFormatString="Editing Claim Form Part" PopUpSettings-Modal="True" PopUpSettings-ScrollBars="None"> <FormTemplate> <div class="rust-form"> <fieldset class="no-bg"> <legend></legend> <ul> <li> <asp:Label runat="server" ID="keyNameLabel" AssociatedControlID="KeyNameTextBox">Name: </asp:Label> <asp:TextBox runat="server" ID="keyNameTextBox"></asp:TextBox> </li> <li> <asp:Label runat="server" ID="keyValueLabel" AssociatedControlID="KeyValueTextBox">Value: </asp:Label> <asp:TextBox runat="server" ID="keyValueTextBox"></asp:TextBox> </li> </ul> </fieldset> <ul class="rust-action-btns"> <li> <asp:Button ID="InsertUpdateButton" runat="server" Text="Save" CssClass="rust-primary-btn" TabIndex="1" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "" %>' /> /> </li> <li> <asp:Button ID="ClaimCancelButton" runat="server" CausesValidation="False" Text="Cancel" CssClass="rust-secondary-btn" CommandName="Cancel" /> </li> </ul> </div> </FormTemplate> </EditFormSettings> </MasterTableView> </telerik:RadGrid>protected override void OnInit(EventArgs e){ base.OnInit(e); this.ClaimFormPartsGrid.NeedDataSource += this.ClaimFormPartsGrid_NeedData; this.ClaimFormPartsGrid.ItemDataBound += this.ClaimFormPartsGrid_ItemDataBound; this.ClaimFormPartsGrid.InsertCommand += this.ClaimFormPartsGrid_InsertCommand; this.ClaimFormPartsGrid.UpdateCommand += this.ClaimFormPartsGrid_UpdateCommand; this.ClaimFormPartsGrid.DeleteCommand += this.ClaimFormPartsGrid_DeleteCommand;}protected void ClaimFormPartsGrid_NeedData(object sender, GridNeedDataSourceEventArgs e){ var source = new List<KeyValuePair<string, string>>(); source.Add(new KeyValuePair<string, string>("1", "1")); source.Add(new KeyValuePair<string, string>("2", "2")); source.Add(new KeyValuePair<string, string>("3", "3")); source.Add(new KeyValuePair<string, string>("4", "4")); this.ClaimFormPartsGrid.DataSource = source;}protected void ClaimFormPartsGrid_ItemDataBound(object sender, GridItemEventArgs e){ if(e.Item.IsInEditMode) { var gei = e.Item as GridEditableItem; if(gei == null) { return; } var nameTextbox = (TextBox)gei.FindControl("keyNameTextBox"); var valueTextbox = (TextBox) gei.FindControl("keyValueTextBox"); if(gei.OwnerTableView.IsItemInserted) { // Inserting. nameTextbox.Text = string.Empty; valueTextbox.Text = string.Empty; } else { // Editing. var keyValue= (KeyValuePair<string, string>) gei.DataItem; nameTextbox.Text = keyValue.Key.ToString(); valueTextbox.Text = keyValue.Value.ToString(); } } else { // displaying var gdi = e.Item as GridDataItem; if (gdi == null) { return; } var keyValue= (KeyValuePair<string,string>)gdi.DataItem; var deleteButton = gdi["DeleteCommand"].Controls[0] as LinkButton; if(deleteButton != null) { deleteButton.Attributes["onclick"] = "return confirm('Are you sure you want to delete " + keyValue.Key + "?')"; } }}protected void ClaimFormPartsGrid_InsertCommand(object sender, GridCommandEventArgs e){ var gei = e.Item as GridEditableItem; if (gei == null) { return; } var nameTextbox = (TextBox)gei.FindControl("keyNameTextBox"); var valueTextbox = (TextBox)gei.FindControl("keyValueTextBox");}protected void ClaimFormPartsGrid_UpdateCommand(object sender, GridCommandEventArgs e){ var gei = e.Item as GridEditableItem; if (gei == null) { return; } var oldName = (KeyValuePair<string, string>)gei.DataItem; var nameTextbox = (TextBox)gei.FindControl("keyNameTextBox"); var valueTextbox = (TextBox)gei.FindControl("keyValueTextBox");}protected void ClaimFormPartsGrid_DeleteCommand(object sender, GridCommandEventArgs e){ var gei = e.Item as GridEditableItem; if (gei == null) { return; }}