hi
i use these codes for fill combobox
//Item Request
i use these codes for fill combobox
//Item Request
protected void Customer_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e) { LoadCustomerData(); (o as RadComboBox).Items.Clear(); string text = e.Text; try { DataRow[] rows = CustomerData.Select("title LIKE '" + text + "*'"); int itemsPerRequest = 20; int itemOffset = e.NumberOfItems; int endOffset = itemOffset + itemsPerRequest; if (endOffset > rows.Length) { endOffset = rows.Length; } for (int i = itemOffset; i < endOffset; i++) { (o as RadComboBox).Items.Add(new RadComboBoxItem(rows[i]["title"].ToString())); } e.Message = String.Format("رکورد <b>1</b>-<b>{0}</b> از <b>{1}</b> رکورد", endOffset.ToString(), rows.Length.ToString()); } catch { } }
********************************************************************************
private void LoadCustomerData() { if (Cache["CustomerData"] == null) { DataTable words = new DataTable("words"); DataColumn title = words.Columns.Add("title"); DataColumn id = words.Columns.Add("id"); string word = String.Empty; List<CDS.IAS.Logic.Sale.User.NameResult> result = CDS.IAS.Logic.Sale.Customer.Customer.GetCustomerName(); foreach (var item in result) { words.Rows.Add(item.FullName, item.ID); } Cache["CustomerData"] = words; } CustomerData = (DataTable)Cache["CustomerData"]; }********************************************************************************
and in page load:
if (!IsPostBack)
{
LoadCustomerData();
}
i just set Item but i need to insert value
beacuse i use to my program this code:combobox.selected value
please help to me
thanks a lot