or
I have gone through a couple of examples to achieve this. I am unable to bind my combobox to a datasource. The combobox on dropdown doesn't display a list of values.
I have a RadGrid as follows:
_RadGrid1.MasterTableView.DataKeyNames = new string[] { this._PopRuleList.PopCapabilityRuleIdColumn.ColumnName }; _RadGrid1.Width = Unit.Percentage(98); _RadGrid1.PageSize = 15; _RadGrid1.AllowPaging = true; _RadGrid1.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric; _RadGrid1.AllowSorting = true; _RadGrid1.AllowFilteringByColumn = _ShowFilter; _RadGrid1.ShowStatusBar = _ShowFilter; _RadGrid1.AutoGenerateColumns = false; _RadGrid1.MasterTableView.NoMasterRecordsText = "There are no exceptions."; _RadGrid1.Skin = "WebBlue"; _RadGrid1.MasterTableView.Width = Unit.Percentage(100); _RadGrid1.ItemCommand += RadGrid1_ItemCommand; _RadGrid1.ShowHeader = true;
string ColumnName = "Bandwidth"; boundColumn = new GridBoundColumn(); boundColumn.FilterTemplate = new MyTemplate(ColumnName, _RadGrid1); _RadGrid1.MasterTableView.Columns.Add(boundColumn); boundColumn.DataField = this._PopRuleList.BandwidthsColumn.ColumnName; boundColumn.AllowFiltering = true; boundColumn.HeaderText = "Bandwidth"; boundColumn.UniqueName = "Bandwidth"; boundColumn.HeaderStyle.Width = Unit.Pixel(25);Also I have the following class:
class MyTemplate : ITemplate { protected RadComboBox combo; private string colname; RadGrid radgrid; GlobalCrossing.IFO.ServerControls.Pops.CapabilitiesExceptionListCtrl ce = new GlobalCrossing.IFO.ServerControls.Pops.CapabilitiesExceptionListCtrl(); public MyTemplate(string cName, RadGrid grid) { colname = cName; radgrid = grid; } public void InstantiateIn(System.Web.UI.Control container) { combo = new RadComboBox(); combo.ID = "RadComboBoxControl"; combo.DataBinding += new EventHandler(RadComboBoxControl_DataBinding); container.Controls.Add(combo); combo.AutoPostBack = true; combo.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(RadComboBoxControl_SelectedIndexChanged); } public void RadComboBoxControl_DataBinding(object sender, EventArgs e) { RadComboBox combo = (RadComboBox)sender; GridFilteringItem container = (GridFilteringItem)combo.NamingContainer; combo.DataTextField = ce._PopRuleList.BandwidthsColumn.ColumnName; combo.DataValueField = ce._PopRuleList.BandwidthsColumn.ColumnName; combo.DefaultItem.Text = "All"; combo.EnableAutomaticLoadOnDemand = true; combo.AllowCustomText = true; combo.DataSource = ce._PopRuleList; } void RadComboBoxControl_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e) { RadComboBox combo = sender as RadComboBox; string filterExpression; filterExpression = "([Bandwidth] LIKE '" + e.Value + "')"; radgrid.MasterTableView.FilterExpression = filterExpression; radgrid.MasterTableView.Rebind(); } }Please let me know how can I bind the RadComboBox so that it displays a list of values to select from.



A post in the Support Forums doesn't guarantee you a
response from the Telerik support team although 95% of all posts are
eventually answered. Additionally, a post is not assigned a response
time as with the support ticketing system. In case you need a faster and precise response, please start a new support ticket as it gets higher priority than Forum posts.
Telerik strives to constantly improve its support services but it is
essential to have full information so as to supply precise replies. It
is important that you follow the guidelines below in order to receive an
accurate response:
GUIDELINES TO USING THE SUPPORT FORUM
ENJOY!!!
function treeExpandAllNodes() { var treeView = $find("<%= rtvMain.ClientID %>"); var nodes = treeView.get_allNodes(); for (var i = 0; i < nodes.length; i++) { if (nodes[i].get_nodes() != null) { nodes[i].expand(); } }}