Hi, I'm using RadComboBox ("RadControls for ASPNET AJAX Q1 2008") with load on demand. I seem to have it half-working. It will successfully display "1-10 of 8836", and when I type in the first few letters of any of the first ten items in the list it will successfully highlight that item which matches. The problem is that when I type in letters which should match items which are not in the first ten it will not find it; it will say "Loading..." for a few seconds but then "Loading..." will disappear and no items will be selected even though I have confirmed that what I'm searching for should be in the list based on what I'm seeing in the database.
My code is below, most of which I copied from your website:
http://www.telerik.com/DEMOS/ASPNET/Prometheus/ComboBox/Examples/PopulatingWithData/AutoCompleteSql/DefaultVB.aspx
<asp:GridView Width=100% ID="gvLines" runat=server AutoGenerateColumns=false>
<HeaderStyle CssClass=dgheader/>
<RowStyle CssClass=dgrows />
<Alternatingrowstyle CssClass=dgalternating />
<Columns>
<asp:TemplateField HeaderText="Customer">
<ItemTemplate>
<telerik:RadComboBox
ID="RadComboBox1" runat="server" Width="250px" Height="200px"
AllowCustomText="True" ShowToggleImage="True" ShowMoreResultsBox="true"
EnableLoadOnDemand="True" MarkFirstMatch="True" OnItemsRequested="RadComboBox1_ItemsRequested" EnableVirtualScrolling="true">
</telerik:RadComboBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
-------------------------------------
Protected Sub RadComboBox1_ItemsRequested(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs)
Dim sql As String = "SELECT CUSTOMER = RTRIM(CUST_NO) + ' - ' + CUST_NAME from DATA_POOL.DBO.Customer (NOLOCK) "
Dim adapter As New SqlDataAdapter(sql, conn)
Dim data As New DataTable()
adapter.Fill(data)
Dim rcb As RadComboBox = CType(o, RadComboBox)
Try
Dim itemsPerRequest As Integer = 10
Dim itemOffset As Integer = e.NumberOfItems
Dim endOffset As Integer = itemOffset + itemsPerRequest
If endOffset > data.Rows.Count Then
endOffset = data.Rows.Count
End If
If endOffset = data.Rows.Count Then
e.EndOfItems = True
End If
Dim i As Integer = itemOffset
While i < endOffset
rcb.Items.Add(New RadComboBoxItem(data.Rows(i)("CUSTOMER").ToString(), data.Rows(i)("CUSTOMER").ToString()))
i = i + 1
End While
If data.Rows.Count > 0 Then
e.Message = [String].Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", endOffset.ToString(), data.Rows.Count.ToString())
Else
e.Message = "No matches"
End If
Catch
e.Message = "No matches"
End Try
End Sub
Is there something wrong with my method of initiating a server side radAlert?
Each time i press button1, the memory for iexplore.exe jumps up a few K, and every time thereafter. So it only takes a dozen or so clicks to go from 30K->70K. If I replace the RadAlert with a normal javascript alert in the code there is no problem.
ajax aspx page
<asp:Label ID="Label1" runat="server" Text="Click 'New' button as many times as you want to add new items and then click 'Save' to udpated the CheckBoxList"></asp:Label>
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button_Click"/>
<asp:Button ID="Button2" runat="server" Text="Button" OnClick="Button_Click"/>
<asp:CheckBoxList ID="CheckBoxList1" runat="server" style="z-index: 101; left: 251px; position: absolute; top: 91px" Height="51px" Width="26px">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
</asp:CheckBoxList>
<asp:ListBox ID="ListBox1" runat="server" style="z-index: 102; left: 204px; position: absolute; top: 87px" Height="191px" Width="34px">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
</asp:ListBox>
<telerik:RadAjaxManager ID="TelerikjaxManager1" runat="server" OnResolveUpdatedControls="AjaxManager1_ResolveUpdatedControls" OnAjaxSettingCreated="TelerikjaxManager1_AjaxSettingCreated" OnAjaxSettingCreating="TelerikjaxManager1_AjaxSettingCreating">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="Button1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="Button1" />
<telerik:AjaxUpdatedControl ControlID="ListBox1" />
<telerik:AjaxUpdatedControl ControlID="TextBox1" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="Button2">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="Button2" />
<telerik:AjaxUpdatedControl ControlID="CheckBoxList1" />
<telerik:AjaxUpdatedControl ControlID="TextBox2" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="WebBlue" Animation="None" Behavior="Default" Behaviors="Default" InitialBehavior="None" InitialBehaviors="None" Left="" Top="">
<Windows>
</Windows>
</telerik:RadWindowManager>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
Code behind is:
protected void Button_Click(object sender, EventArgs e)
{
TextBox1.Text =
"";
TextBox2.Text =
"";
switch (((Button) sender).ID)
{
case "Button1":
{
ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "RadAlertScript", "radalert('test');", true);
ListBox1.Items.Add(
new ListItem((ListBox1.Items.Count + 1).ToString()));
updateControlID =
"ListBox1";
TextBox1.Text =
"Button1";
TextBox2.Text =
"Button2";
break;
};
case "Button2":
{
for (int i = CheckBoxList1.Items.Count; i < ListBox1.Items.Count; i++)
{
CheckBoxList1.Items.Add(
new ListItem((i + 1).ToString()));
}
updateControlID =
"CheckBoxList1";
TextBox1.Text =
"Button1";
TextBox2.Text =
"Button2";
break;
}
}
}
<
asp:Button ID="btnUpdate" runat="server" Text="Save" />
<asp:Button ID="btnCancel" runat="server" CausesValidation="false" Text="Cancel" OnClientClick="closeWin(); return false;"/>
<script type="text/javascript">
function GetRadWindow()
{
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow;
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
return oWindow;
}
function closeWin()
{
var oWnd = GetRadWindow();
oWnd.close();
top.location.href=top.location.href; originalAttribute="href" originalPath="top.location.href;" originalAttribute="href" originalPath="top.location.href;"
}
</script>
var chk=document.getElementById("<%=myCheckBox.ClientID%>");
var productsp = $find("<%=newSplitter.ClientID%>");
var productpane = productsp.getPaneById('<%=FirstPane.ClientID%>');
var packagepane = productsp.getPaneById('<%=SearchResultPackage.ClientID%>');
if(chk.checked)
{
if(packagepane.get_collapsed())
{
packagepane.expand();
}
if(!productpane.get_collapsed())
{
productpane.collapse();
}
}
else
{
if(productpane.get_collapsed())
{ productpane.expand(); }
if(!packagepane.get_collapsed())
{ packagepane.collapse(); }
}
this is working fine in IE6 but in Firefox packagepane did not expand and i have checked its whidth it becomes zero.
i have fixed its width then also it is creating problem.
please tell me how can i fix it....