
public class filterSimpleCtrl : WebControl { private RadFilter _rf = new RadFilter(); private Label _label = new Label(); private RadScriptManager sm = new RadScriptManager(); protected override void OnInit(EventArgs e) { base.OnInit(e); this.Page.Form.Controls.Add(sm); this._label.ID = "_label"; this._rf.ID = "_rf"; this._rf.FilterContainerID = "RadGrid1"; this._rf.ExpressionPreviewPosition = RadFilterExpressionPreviewPosition.Bottom; this._rf.ApplyExpressions += _rf_ApplyExpressions; this._rf.ExpressionItemCreated += _rf_ExpressionItemCreated; RadFilterTextFieldEditor rfe2 = new RadFilterTextFieldEditor(); rfe2.FieldName = "City"; rfe2.DisplayName = "City"; rfe2.DefaultFilterFunction = RadFilterFunction.Contains; _rf.FieldEditors.Add(rfe2); RadFilterDropDownEditor rfe = new RadFilterDropDownEditor(); rfe.FieldName = "CountryCode"; rfe.DisplayName = "Country Code"; rfe.DataTextField = "CountryCode"; rfe.DefaultFilterFunction = RadFilterFunction.EqualTo; _rf.FieldEditors.Add(rfe); this.Page.Form.Controls.Add(_rf); this.Page.Form.Controls.Add(new LiteralControl("<br />")); this.Page.Form.Controls.Add(_label); } protected void _rf_ExpressionItemCreated(object sender, RadFilterExpressionItemCreatedEventArgs e) { // Populate the RadDropDownList control for every ShipCountry field editor RadFilterSingleExpressionItem singleItem = e.Item as RadFilterSingleExpressionItem; if (singleItem != null && singleItem.FieldName == "CountryCode" && singleItem.IsSingleValue) { RadDropDownList dropDownList = singleItem.InputControl as RadDropDownList; dropDownList.DataSource = GetListData("country"); dropDownList.DataBind(); } // Removes the AddGroupExpressionButton for group expression other than the root group RadFilterGroupExpressionItem groupItem = e.Item as RadFilterGroupExpressionItem; if (groupItem != null) { if (groupItem.IsRootGroup) groupItem.RemoveButton.Visible = false; else groupItem.AddGroupExpressionButton.Visible = false; } } void _rf_ApplyExpressions(object sender, RadFilterApplyExpressionsEventArgs e) { RadFilterSqlQueryProvider queryProvider = new RadFilterSqlQueryProvider(); queryProvider.OnExpressionEvaluated = this.ExpressionEvaluated; queryProvider.ProcessGroup(e.ExpressionRoot); this._label.Text = queryProvider.Result; } private void ExpressionEvaluated(RadFilterEvaluationData evaluationData) { RadFilterFunction filterFunction = evaluationData.Expression.FilterFunction; if (evaluationData.Expression.FieldName == "CountryCode" && filterFunction == RadFilterFunction.EqualTo || filterFunction == RadFilterFunction.NotEqualTo) { //NONE OF THESE WORK //string value = (evaluationData.Expression as RadFilterContainsFilterExpression).Value; //string value = (((IRadFilterValueExpression)evaluationData.Expression).Values[0] as RadFilterDropDownEditor).ExtractValues()[0].ToString(); //string value = (((IRadFilterValueExpression)evaluationData.Expression).Values[0] as RadDropDownList).SelectedValue; RadFilterNonGroupExpression expression = null; RadFilterSqlExpressionEvaluator evaluator = RadFilterSqlExpressionEvaluator.GetEvaluator(evaluationData.Expression.FilterFunction); expression = new RadFilterEqualToFilterExpression<string>("CountryCode") { Value = value }; evaluator.GetEvaluationData(expression).CopyTo(evaluationData); } } private DataTable GetListData(string list) { string query = ""; switch (list) { case "country": query = "SELECT CountryCode FROM Country"; break; default: break; } string conString = ConfigurationManager.ConnectionStrings["constr"].ConnectionString; SqlCommand cmd = new SqlCommand(query); using (SqlConnection con = new SqlConnection(conString)) { using (SqlDataAdapter sda = new SqlDataAdapter()) { cmd.Connection = con; sda.SelectCommand = cmd; using (DataTable dt = new DataTable()) { sda.Fill(dt); return dt; } } } } }
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="InstrumentSetupContainer.aspx.cs" Inherits="BusinessSettingsSetup_InstrumentSetupContainer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<link href="../Styles/Form.css" rel="stylesheet" type="text/css" />
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" ></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel2" runat="server" >
<ContentTemplate>
<fieldset>
<asp:UpdateProgress ID="progress1" runat="server">
<ProgressTemplate>
<img alt="" src="../Images/loader.gif" />
Please Wait...
</ProgressTemplate>
</asp:UpdateProgress>
<div>
<telerik:RadTabStrip ID="RadTabStrip1" runat="server" Skin="Black"
MultiPageID="RadMultiPage1" SelectedIndex="0" >
<Tabs>
<telerik:RadTab Text="Instrument"></telerik:RadTab>
<telerik:RadTab Text="Instrument Catagories"></telerik:RadTab>
<telerik:RadTab Text="Instrument Exchange Listing"></telerik:RadTab>
<telerik:RadTab Text="Instrument Margin"></telerik:RadTab>
</Tabs>
</telerik:RadTabStrip>
<telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0">
<telerik:RadPageView ID="RadPageView1" runat="server" Height="600px" ContentUrl="InstrumentSetup.aspx">
</telerik:RadPageView>
<telerik:RadPageView ID="RadPageView2" runat="server" Height="600px" ContentUrl="InstrumentCategoryDatewiseSetup.aspx">
</telerik:RadPageView>
<telerik:RadPageView ID="RadPageView3" runat="server" Height="600px" ContentUrl="InstrumentExchangeListingSetup.aspx">
</telerik:RadPageView>
<telerik:RadPageView ID="RadPageView4" runat="server" Height="600px" ContentUrl="InstrumentMarginDatewiseSetup.aspx">
</telerik:RadPageView>
</telerik:RadMultiPage>
</div>
</fieldset>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>

As i have updated Telerik dll's but after updating i am getting below Errors and i am not using any types of triggers and asp update panels so please tell me asap and i am also attaching screen shot of below error(image_xi) and Telerik Ajax settings screen shot.
Hi, The result set from database comes back as the following data. It is parent child relation. TransactionID 1009 has 3 child records in the database with 3 accounts. The total transaction amount is $12/- (3 + 4+5). So parent table has ID and other data. Child table has Account#, AccountName, Amount, parentID and some other fields. ID Name Account# AccountName Amount 1007 Sam 31747 a 1 1008 Sam 31748 av 2 1009 Sam 31797 ab 3 1009 Sam 31798 ac 4 1009 Sam 31799 ad 5 When it is displayed in the radgrid, we are showing it like this: ID Name AccountNum AccountName Amount 1007 Sam 31747 a 1 1008 Sam 31748 av 2 1009 Sam 31797 Ab ($3) 12
31798 Ac ($4) 31799 Ad ($5) We are achieving this by doing this logic: While (reader.Read()) { //logic to check old transaction or new transaction by comparing ID If (newID != oldID) { //new transaction. So do the code } Else { //still previous transaction. So concatenate account numbers accountNum += "<br/>" + reader.GetString(reader.GetOrdinal("AccountNumber")); accountName += "<br/>" + reader.GetString(reader.GetOrdinal("AccountName")); amount += reader.GetDecimal(reader.GetOrdinal("Amount")); } } I want this grid data to be exported to BIFF format excel like this: ID Name Account# AccountName Amount 1007 Sam 1 31747 a 1008 Sam 2 31748 av 1009 Sam 12 31797 Ab ($3) 31798 Ac ($4) 31799 Ad ($5) I tried using ExportInfrastructure and shiftingRowsDown method in a loop, it works for only 1007 and 1008 rows. But not to 1009. I understand why. That has been treated as 1 row eventhough there are multiple accounts. The account# column is just string concatenation. So, when I am exporting looks like I need to use my original dataset. I tried to create another radgrid programmatically and assign original result set. We have a btn upon clicking it, I export data to excel like this: protected void btnExport_Click(object sender, EventArgs e) { radGrid.Page.Response.ClearHeaders(); radGrid.Page.Response.Cache.SetCacheability(HttpCacheability.Private); radGrid.MasterTableView.ExportToExcel(); } protected void rgdChecks_BiffExporting(object sender, Telerik.Web.UI.GridBiffExportingEventArgs e) { } Where should I programmatically create radgrid and do customize data to look like above. We do not want to use hierarchical grid. Please let me know how to get this kind of output? Thanks, Prathiba.