Hello!
The problem is - if I open combobox with selected value and click "ShowMoreResults" arrow or perform virtual scroll down, items with the same text as selected one appears in list. At the ItemsRequested handler number of items remains as it expected.
How can I prevent the behaviour described above?
Controls version - 2008.3.1016.35
Here the test to illustrate issue:
ASPX
CS
The problem is - if I open combobox with selected value and click "ShowMoreResults" arrow or perform virtual scroll down, items with the same text as selected one appears in list. At the ItemsRequested handler number of items remains as it expected.
How can I prevent the behaviour described above?
Controls version - 2008.3.1016.35
Here the test to illustrate issue:
ASPX
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="Test.WebApplication.test" %> |
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
<html xmlns="http://www.w3.org/1999/xhtml" > |
<head runat="server"> |
<title></title> |
</head> |
<body> |
<form id="form1" runat="server"> |
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"> |
</telerik:RadScriptManager> |
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder> |
</form> |
</body> |
</html> |
using System; |
using System.Data; |
using Telerik.Web.UI; |
namespace Test.WebApplication |
{ |
public partial class test : System.Web.UI.Page |
{ |
public static DataTable currencyTable; |
protected RadComboBox RadCombobox1; |
protected void Page_Init(object sender, EventArgs e) |
{ |
RadCombobox1 = new RadComboBox(); |
RadCombobox1.AllowCustomText = false; |
RadCombobox1.EnableItemCaching = true; |
RadCombobox1.AutoPostBack = true; |
RadCombobox1.IsCaseSensitive = false; |
RadCombobox1.SortCaseSensitive = false; |
RadCombobox1.Filter = RadComboBoxFilter.Contains; |
RadCombobox1.EnableLoadOnDemand = true; |
RadCombobox1.EnableVirtualScrolling = true; |
RadCombobox1.ShowMoreResultsBox = true; |
RadCombobox1.ShowDropDownOnTextboxClick = false; |
RadCombobox1.ItemsRequested += RadCombobox1_ItemsRequested; |
PlaceHolder1.Controls.Add(RadCombobox1); |
} |
private void RadCombobox1_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e) |
{ |
} |
protected void Page_Load(object sender, EventArgs e) |
{ |
if (!IsPostBack) |
{ |
currencyTable = CreateCurrencyTable(); |
RadCombobox1.DataTextField = "name"; |
RadCombobox1.DataValueField = "id"; |
RadCombobox1.DataSource = currencyTable; |
RadCombobox1.DataBind(); |
} |
} |
protected DataTable CreateCurrencyTable() |
{ |
var table = new DataTable(); |
DataRow row; |
DataColumn column; |
column = new DataColumn(); |
column.DataType = System.Type.GetType("System.Int32"); |
column.ColumnName = "id"; |
column.ReadOnly = false; |
column.Unique = true; |
table.Columns.Add(column); |
column = new DataColumn(); |
column.DataType = System.Type.GetType("System.String"); |
column.ColumnName = "name"; |
column.ReadOnly = false; |
column.Unique = false; |
table.Columns.Add(column); |
row = table.NewRow(); |
row["name"] = "RUR"; |
row["id"] = 1; |
table.Rows.Add(row); |
row = table.NewRow(); |
row["name"] = "USD"; |
row["id"] = 2; |
table.Rows.Add(row); |
row = table.NewRow(); |
row["name"] = "EURO"; |
row["id"] = 3; |
table.Rows.Add(row); |
return table; |
} |
} |
} |