<telerik:RadComboBox ID="rcbSearch" runat="server" CausesValidation="false" AutoPostBack="true" Width="160px" EmptyMessage="Select the Search Criteria" DropDownWidth="200px" HighlightTemplatedItems="true" EnableLoadOnDemand="true" Filter="StartsWith" OnItemsRequested="rcbSearch_ItemsRequested" Skin="Web20" onselectedindexchanged="rcbSearch_SelectedIndexChanged"> <HeaderTemplate> <table style="width: 200px" cellspacing="0" cellpadding="0"> <tr> <td align="left" style="width: 20px;"> Code</td> <td align="left" style="width: 60px;"> Description</td> </tr> </table> </HeaderTemplate> <ItemTemplate> <table style="width: 200px" cellspacing="0" cellpadding="0"> <tr> <td align="left" style="width: 20px;"> <%# DataBinder.Eval(Container, "Text")%> </td> <td align="left" style="width: 60px;"> <%# DataBinder.Eval(Container, "Attributes['Description']")%> </td> </tr> </table> </ItemTemplate> </telerik:RadComboBox>
protected void rcbSearch_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e) { fnbindComboBox(); } #endregion private void fnbindComboBox() { DataTable dtTableDetails = new DataTable(); _objAction = new DALSdfAction(); dtTableDetails = _objAction.getTableDetails("sdfAction"); foreach (DataRow dr in dtTableDetails.Rows) { RadComboBoxItem item = new RadComboBoxItem(); item.Text = dr["sdfActionID"].ToString(); string description = dr["dsc"].ToString(); item.Attributes.Add("Description", description); rcbSearch.Items.Add(item); item.DataBind(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)