I have the following Column in my RadGrid,
This is the code,
I want the RadComboBox to filter with ID, but on UI it should show name. Is it possible
<Telerik:DDLGridColumn UniqueName="ProductType" Query="select Name AS ProductType, ID AS ProductTypeID From ProductTypes WHERE RetailerID={1}" GetRetailerIDFromSession="True" DataField="ProductType" DataValueField="ProductTypeID" HeaderText="ProductType" SortExpression="ProductType"> <ItemTemplate> <%# Eval("ProductType")%> </ItemTemplate></Telerik:DDLGridColumn>This is the code,
public class DDLGridColumn: GridTemplateColumn { protected override void SetupFilterControls(System.Web.UI.WebControls.TableCell cell) { RadComboBox rcBox = new RadComboBox(); rcBox.ID = this.UniqueName + "_rcbox"; rcBox.AutoPostBack = true; rcBox.DataTextField = this.DataField; rcBox.DataValueField = DataValueField ?? this.DataField; rcBox.SelectedIndexChanged += rcBox_SelectedIndexChanged; rcBox.Width = FilterControlWidth; string query = query = string.Format(this.Query, this.DataField); DataTable table = DBLayer.GetDataTable(query, CommandType.Text); DataRow row = table.NewRow(); table.Rows.InsertAt(row, 0); rcBox.DataSource = table; cell.Controls.Add(rcBox); } private void rcBox_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e) { ((GridFilteringItem)(((RadComboBox)sender).Parent.Parent)).FireCommandEvent("Filter", new Pair()); } protected override void SetCurrentFilterValueToControl(TableCell cell) { if (!(this.CurrentFilterValue == "")) { ((RadComboBox)cell.Controls[0]).Items.FindItemByValue(this.CurrentFilterValue).Selected = true; } } protected override string GetCurrentFilterValueFromControl(TableCell cell) { string currentValue = ((RadComboBox)cell.Controls[0]).SelectedItem.Value; this.CurrentFilterFunction = (currentValue != "") ? GridKnownFunction.EqualTo : GridKnownFunction.NoFilter; return currentValue; } }I want the RadComboBox to filter with ID, but on UI it should show name. Is it possible