Hi friends,
I have been trying to place some extra fields like field1, field2 along with the Rad grid columns into rad filter. When i am trying below code i am not able to see my added fields 'field1, field2" in rad filter. any suggestions..? i DONT WANT TO USE DATASOURCE ID..
The code i am using to create dataset..
I have been trying to place some extra fields like field1, field2 along with the Rad grid columns into rad filter. When i am trying below code i am not able to see my added fields 'field1, field2" in rad filter. any suggestions..? i DONT WANT TO USE DATASOURCE ID..
<body> <form id="form1" runat="server"> <div> <telerik:RadScriptManager ID="RadScriptManager1" Runat="server"> </telerik:RadScriptManager> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> <br /> <telerik:RadFilter ID="RadFilter1" runat="server" FilterContainerID="RadGrid1" onapplyexpressions="RadFilter1_ApplyExpressions"> <FieldEditors> <telerik:RadFilterTextFieldEditor FieldName="field1" DataType="System.String" /> <telerik:RadFilterTextFieldEditor FieldName="field2" DataType="System.String" /> </FieldEditors> </telerik:RadFilter> <br /> <br /> </div> <telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="0" GridLines="None" AllowAutomaticInserts="True" DataSourceID="SqlDataSource1" ShowGroupPanel="True"><HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu><MasterTableView AutoGenerateColumns="False" DataSourceID="SqlDataSource1" ><CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings><RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn><ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn> <Columns> <telerik:GridBoundColumn DataField="MachineName" FilterControlAltText="Filter MachineName column" HeaderText="MachineName" SortExpression="MachineName" UniqueName="MachineName"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="OperatingSystem" FilterControlAltText="Filter OperatingSystem column" HeaderText="OperatingSystem" SortExpression="OperatingSystem" UniqueName="OperatingSystem"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Location" FilterControlAltText="Filter Location column" HeaderText="Location" SortExpression="Location" UniqueName="Location"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="IPAddress" FilterControlAltText="Filter IPAddress column" HeaderText="IPAddress" SortExpression="IPAddress" UniqueName="IPAddress" Visible=false> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Site_Name" FilterControlAltText="Filter Site_Name column" HeaderText="Site_Name" SortExpression="Site_Name" UniqueName="Site_Name" > </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Status_ID" FilterControlAltText="Filter Status_ID column" HeaderText="Status_ID" SortExpression="Status_ID" UniqueName="Status_ID" Visible=false > </telerik:GridBoundColumn> </Columns><EditFormSettings><EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn></EditFormSettings></MasterTableView> <ClientSettings AllowDragToGroup="True"> <Scrolling AllowScroll="True" UseStaticHeaders="True" /> </ClientSettings><FilterMenu EnableImageSprites="False" DataValueField="Location"></FilterMenu> </telerik:RadGrid> <telerik:RadAjaxManager runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RadGrid1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:sitemgrConnectionString %>" SelectCommand="TELRIK" SelectCommandType="StoredProcedure"> </asp:SqlDataSource> </form></body></html>using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using Telerik.Web.UI;using System.Data;using System.Data.SqlClient;using System.Configuration;public partial class _Default : System.Web.UI.Page { string conStr = ConfigurationManager.ConnectionStrings["conn44"].ConnectionString; protected void Page_Load(object sender, EventArgs e) { RadGrid1.GroupingSettings.CaseSensitive = false; RadGrid1.ShowGroupPanel = true; RadGrid1.ClientSettings.AllowDragToGroup = true; RadFilterTextFieldEditor editor1 = new RadFilterTextFieldEditor(); RadFilter1.FieldEditors.Add(editor1); editor1.FieldName = "field1"; editor1.DataType = typeof(string); editor1.DisplayName = "field1"; RadFilterTextFieldEditor editor2 = new RadFilterTextFieldEditor(); RadFilter1.FieldEditors.Add(editor2); editor2.FieldName = "field2"; editor2.DataType = typeof(string); editor2.DisplayName = "field2"; } protected void RadFilter1_ApplyExpressions(object sender, RadFilterApplyExpressionsEventArgs e) { RadFilterSqlQueryProvider provider = new RadFilterSqlQueryProvider(); provider.ProcessGroup(e.ExpressionRoot); Label1.Text = provider.Result; }}