or
<telerik:RadComboBox ID="cboLocation" EmptyMessage="Location ID or Name" Width="250px" CheckBoxes="true" Skin="Default" EnableLoadOnDemand="True" ShowMoreResultsBox="true" ForeColor="Black" EnableVirtualScrolling="true" Font-Size="12px" OnClientItemChecked="OnClientItemCheckedLoc" OnClientDropDownClosed="OnClientDropDownClosedLoc" AutoPostBack="false" runat="server" OnItemsRequested="cboLocation_ItemsRequested" EnableCheckAllItemsCheckBox="true" OnClientBlur="IsCheckAllSelectedLoc" ShowToggleImage="false" ZIndex="1000000" ></telerik:RadComboBox>
<telerik:RadTreeList ID="lstApplications" runat="server" AllowSorting="True" ParentDataKeyNames="ParentID" DataKeyNames="AppID" OnNeedDataSource="lstApplications_NeedDataSource" AutoGenerateColumns="False" AllowPaging="True" PageSize="15" TabIndex="3" > <clientsettings> <Selecting AllowItemSelection="True" /> <ClientEvents OnItemClick="OnItemClick" OnItemDblClick="OnItemDblClick" /> <selecting allowitemselection="True" /> </clientsettings> <Columns> <telerik:TreeListBoundColumn DataField="AppID" HeaderText="AppID" UniqueName="AppID" Visible="false" ReadOnly="True" /> <telerik:TreeListBoundColumn DataField="Name" HeaderText="Application" ItemStyle-Width="20%" UniqueName="Name" ReadOnly="True"> <HeaderStyle Width="20%" /> <ItemStyle Width="20%" /> </telerik:TreeListBoundColumn> <telerik:TreeListBoundColumn DataField="Description" HeaderText="Description" UniqueName="Description" ReadOnly="True" /> </Columns> </telerik:RadTreeList>public class MyData { public static List<MyItem> GetData(String prefixText) { var mergedList = GetParentData(prefixText).Union(GetChildData(prefixText)).ToList(); return mergedList; //return GetChildData(prefixText); } public static List<MyItem> GetParentData(String prefixText) { SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["DataAccess.Properties.Settings.SecureConnectionString"].ConnectionString); SqlCommand cmd = new SqlCommand("SelApplicationsParent", cn); cmd.CommandType = CommandType.StoredProcedure; if (!prefixText.Equals(String.Empty)) { cmd.Parameters.AddWithValue("nrows", 30); //Set results limit to prevent typing lag. cmd.Parameters.AddWithValue("term", ("%" + prefixText + "%")); //Set filter by name } List<MyItem> list = new List<MyItem>(); cn.Open(); SqlDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); if (dr.HasRows) { while (dr.Read()) { string AppID = dr["ParentID"].ToString(); string ParentID = ""; //dr["ParentID"].ToString(); string Name = dr["Name"].ToString(); string Description = dr["Description"].ToString(); list.Add(new MyItem(AppID, Name, Description, ParentID)); } } dr.Close(); return list; } public static List<MyItem> GetChildData(String prefixText) { SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["DataAccess.Properties.Settings.SecureConnectionString"].ConnectionString); SqlCommand cmd = new SqlCommand("SelApplicationsChild", cn); cmd.CommandType = CommandType.StoredProcedure; if (!prefixText.Equals(String.Empty)) { cmd.Parameters.AddWithValue("NRows", 30); //Set results limit to prevent typing lag. cmd.Parameters.AddWithValue("Parent", ("%" + prefixText + "%")); } List<MyItem> list = new List<MyItem>(); cn.Open(); SqlDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); if (dr.HasRows) { while (dr.Read()) { string AppID = dr["AppID"].ToString(); string ParentID = dr["ParentID"].ToString(); string Name = dr["Name"].ToString(); string Description = dr["Description"].ToString(); list.Add(new MyItem(AppID, Name, Description, ParentID)); } } dr.Close(); return list; } } public class MyItem { public string AppID { get; set; } public string ParentID { get; set; } public string Name { get; set; } public string Description { get; set; } public MyItem(string appID, string name, string description, string parentID) { AppID = appID; ParentID = parentID; Name = name; Description = description; } } protected void lstApplications_NeedDataSource(object sender, TreeListNeedDataSourceEventArgs e) { lstApplications.DataSource = MyData.GetData(txtFilter.Text); }

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <h3> Agents with Expiring Licenses </h3> <p> These Agents have licenses that are expiring soon. </p><div class="container"> <div class="row10"> <div class="one column" > </div> <div class="fourteen columns" > <telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="True" OnNeedDataSource="RadGrid1_NeedDataSource" Width="99.7%" AutoGenerateColumns="false" AllowPaging="false" OnItemDataBound="RadGrid1_ItemDataBound" AllowFilteringByColumn="True"> <ExportSettings HideStructureColumns="true" Csv-ColumnDelimiter="Comma" IgnorePaging="true" OpenInNewWindow="true" ExportOnlyData="true" > </ExportSettings> <MasterTableView Width="100%" CommandItemDisplay="Top" EnableViewState="true"> <PagerStyle Mode="Slider"></PagerStyle> <CommandItemTemplate> <table class="rcCommandTable" width="100%"> <tr> <td style="float: right; vertical-align:middle;" > <asp:ImageButton runat="server" ID="btnCSVExport" ImageUrl="../Icons/csvdownload.jpg" CommandName="ExportToCSV" Height="24px" Width="24px" ToolTip="Export to CSV" /> <asp:ImageButton runat="server" ID="btnExcelExport" ImageUrl="../Icons/excel.png" CommandName="ExportToExcel" Height="24px" Width="24px" ToolTip="Export to Excel" /> <asp:ImageButton runat="server" ID="btnWordExport" ImageUrl="../Icons/ms_word_2.png" CommandName="ExportToWord" Height="24px" Width="24px" ToolTip="Export to Word" /> <asp:ImageButton runat="server" ID="btnPDFExport" ImageUrl="../Icons/Pdf.png" CommandName="ExportToPDF" Height="24px" Width="24px" ToolTip="Export to PDF" /> </td> </tr> </table> </CommandItemTemplate> <CommandItemSettings ShowExportToWordButton="true" ShowExportToExcelButton="true" ShowExportToCsvButton="true" ShowExportToPdfButton="true"> </CommandItemSettings> <Columns> </Columns> </MasterTableView> </telerik:RadGrid> </div> <div class="one column" > </div> </div></div><br /><div class="container"> <div class="row10"> <div class="sixteen columns" style="text-align: center;" > <telerik:RadButton ID="CloseMe" runat="server" Text="Close Window" CausesValidation="False" ToolTip= "Closes this window." UseSubmitBehavior="False" OnClientClicked="closemenow" /> </div> </div></div><div class="container"> <div class="row10"> <div class="sixteen columns" style="text-align: center;"> <asp:Label ID="PageErrors" runat="server" Font-Bold="True" ForeColor="#C00000" Width="95%"></asp:Label> </div> </div></div></asp:Content><body id="page1"> <telerik:RadFormDecorator Skin="Office2010Silver" Enabled="true" ID="QsfFormDecorator" DecorationZoneID="rfd-demo-zone" runat="server" DecoratedControls="All" EnableRoundedCorners="true" EnableEmbeddedSkins="true" /> <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ></telerik:RadSkinManager> <form id="form1" runat="server"> <div id="rfd-demo-zone" > <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> </telerik:RadScriptManager> <div id="content"> <div class="main"> <div class="xcontainer"> <div class="row-main-25" style="padding-bottom: 10px; "> <!-- navbar start --> <div class="sixteen columns "> <div class="menucontainer" > <section id="loginx"> <asp:LoginView ID="LoginView1" runat="server" ViewStateMode="Disabled"> <AnonymousTemplate> <ul class="sessionnav" id="Ul1" runat="server" style="margin-bottom: 10px; padding-top: 4px; padding-bottom: 6px;"> <li><a id="A4" runat="server" onclick="doNothing();" title="If checked, the site will attempt to display pages by re-using the same window. If you are using a mobile device this will reduce the number of pages opened.">Reuse Windows</a><asp:CheckBox ID="ReuseWindow1" runat="server" onclick="doClick(this)" AutoPostBack="true" ToolTip="If checked, the site will attempt to display pages by re-using the same window. If you are using a mobile device this will reduce the number of pages opened by Broker+." /></li> <li><a id="A3" runat="server" href="~/Account/Login.aspx">Log in</a></li> <li><a id="A2" runat="server" href="~/Account/Register.aspx" >Register</a></li> </ul> </AnonymousTemplate> <LoggedInTemplate> <ul class="sessionnav" id="Ul2" runat="server" style="margin-bottom: 10px; padding-top: 4px; padding-bottom: 6px;"> <li><a id="A5" runat="server" onclick="doNothing();" title="If checked, the site will attempt to display pages by re-using the same window. If you are using a mobile device this will reduce the number of pages opened by Broker+.">Reuse Windows</a><asp:CheckBox ID="ReuseWindow2" runat="server" onclick="doClick(this)" AutoPostBack="true" ToolTip="If checked, the site will attempt to display pages by re-using the same window. If you are using a mobile device this will reduce the number of pages opened by Broker+." /></li> <li><a id="A1" runat="server" class="username" href="~/Account/MyAccount.aspx" title="Manage your account"><asp:LoginName ID="LoginName1" runat="server" CssClass="username" /></a></li> <li><asp:LoginStatus ID="LoginStatus1" runat="server" CssClass="username" LogoutAction="Redirect" LogoutText="Log off" LogoutPageUrl="~/logout.aspx" /></li> </ul> <div class="clear"></div> </LoggedInTemplate> </asp:LoginView> </section> </div> </div> <!-- navbar end --> <!-- logo start --> <div class="row10" style="height: 90px; " > <div class="sixteen columns header-bg" style="height: 90px;"> <div style="float: left; "> <img src="" /> </div> <div class="zippy" style="margin-left: 0px; float: left; height: 90px; text-align: center; overflow: no-display;"> <div class="slogan-line"> <telerik:RadTicker AutoStart="true" runat="server" ID="Radticker1" loop="false" DataSourceID="SqlDataSource1" DataTextField="ScrollerText" > </telerik:RadTicker> </div> </div> <div class="findus" style="float: right; height: 90px; text-align: center; background-color: black; "> <div class="header-icons-and-phone"> <div class="header-icons-links"> <img alt="youtube icon" src="<%=Page.ResolveUrl("~/Icons/youtube.png")%>" height="24" width="24" /> <img alt="facebook icon" src="<%=Page.ResolveUrl("~/Icons/facebook.png")%>" height="24" width="24" /> <img alt="twitter icon" src="<%=Page.ResolveUrl("~/Icons/twitter.png")%>" height="24" width="24" /> </div> <div class="header-icons-links2"> <asp:Label Text="Have questions?" ID="Label2" runat="server" Font-Bold="true" Font-Italic="true" Font-Names="Times New Roman" Font-Size="16px" ForeColor="#11bcf0"></asp:Label> <br /> <asp:Label Text="" ID="Label3" runat="server" Font-Bold="true" Font-Size="16px" ForeColor="white"></asp:Label> </div> </div> <div class="clear"></div> </div> <div class="clear"></div> </div> </div> <!-- logo end --> <!-- menu start --> <div class="row10" style="width: 100%; background-color: black; " > <div class="sixteen columns " > <div class="menubar" > <THDi:BrokerPlusMenu ID="BrokerPlusMenu1" runat="server" MenuToLoad="Broker+ Office" ProfileName="Office" /> </div> </div> </div> <!-- menu end --> <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"> </asp:ContentPlaceHolder> </div> protected void Page_Init(object sender, System.EventArgs e) { if (!Page.IsPostBack) { sType = Request["T"]; string sUserFormRules = Convert.ToString(Session["UserBrokerPlusFormsRules"]); string sRule = ""; this.RadGrid1.AllowFilteringByColumn = true; GridHyperLinkColumn hypercolumn = null; GridBoundColumn boundcolumn = null; hypercolumn = new GridHyperLinkColumn(); hypercolumn.HeaderText = "Edit"; hypercolumn.UniqueName = "Agent"; hypercolumn.Text = "<img border=\"0\" alt=\"View\" src=\"../Icons/pencil_16.png\" />"; hypercolumn.DataNavigateUrlFields = new string[] { "Agent" }; hypercolumn.DataNavigateUrlFormatString = "OfcAgentEdit.aspx?M=Y&T=" + sType + "K=" + "{" + "0" + "}"; hypercolumn.AllowFiltering = false; hypercolumn.HeaderStyle.Width = Unit.Pixel(50); hypercolumn.Exportable = false; this.RadGrid1.MasterTableView.Columns.Add(hypercolumn); hypercolumn = new GridHyperLinkColumn(); hypercolumn.HeaderText = "Email"; hypercolumn.UniqueName = "SendAgentMail"; hypercolumn.Text = "<img border=\"0\" alt=\"View\" src=\"../Icons/mailIcon.gif\" />"; hypercolumn.DataNavigateUrlFields = new string[] { "AgentEmail" }; hypercolumn.DataNavigateUrlFormatString = "mailto:" + "{" + "0" + "}"; hypercolumn.HeaderStyle.Width = Unit.Pixel(30); hypercolumn.AllowFiltering = false; hypercolumn.Exportable = false; this.RadGrid1.MasterTableView.Columns.Add(hypercolumn); boundcolumn = new GridBoundColumn(); boundcolumn.UniqueName = "AgentID"; boundcolumn.DataField = "AgentID"; boundcolumn.HeaderText = "ID"; boundcolumn.FilterControlWidth = Unit.Pixel(50); boundcolumn.HeaderStyle.CssClass = "mediumgridcol"; boundcolumn.ItemStyle.CssClass = "mediumgridcol"; boundcolumn.FooterStyle.CssClass = "mediumgridcol"; boundcolumn.Visible = true; boundcolumn.Exportable = true; this.RadGrid1.MasterTableView.Columns.Add(boundcolumn); boundcolumn = new GridBoundColumn(); boundcolumn.UniqueName = "AgentFullName"; boundcolumn.DataField = "AgentFullName"; boundcolumn.HeaderText = "Name"; boundcolumn.HeaderStyle.Width = Unit.Pixel(240); boundcolumn.FilterControlWidth = Unit.Pixel(100); boundcolumn.Visible = true; this.RadGrid1.MasterTableView.Columns.Add(boundcolumn); boundcolumn = new GridBoundColumn(); boundcolumn.UniqueName = "AgentCellular"; boundcolumn.DataField = "AgentCellular"; boundcolumn.HeaderText = "Cellular"; boundcolumn.FilterControlWidth = Unit.Pixel(60); boundcolumn.HeaderStyle.CssClass = "smallgridcol"; boundcolumn.ItemStyle.CssClass = "smallgridcol"; boundcolumn.FooterStyle.CssClass = "smallgridcol"; boundcolumn.Visible = true; boundcolumn.Visible = true; this.RadGrid1.MasterTableView.Columns.Add(boundcolumn); boundcolumn = new GridBoundColumn(); boundcolumn.UniqueName = "AgentEmail"; boundcolumn.DataField = "AgentEmail"; boundcolumn.HeaderText = "Email"; boundcolumn.HeaderStyle.CssClass = "smallgridcol"; boundcolumn.ItemStyle.CssClass = "smallgridcol"; boundcolumn.FooterStyle.CssClass = "smallgridcol"; boundcolumn.Visible = true; boundcolumn.Visible = true; boundcolumn.FilterControlWidth = Unit.Pixel(100); this.RadGrid1.MasterTableView.Columns.Add(boundcolumn); RadGrid1.AllowPaging = Convert.ToBoolean(Session["ShowListsWithPaging"]); RadGrid1.PageSize = 20; } else { sType = Request["T"]; } } protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) { // this code is used to make filter columns visible/invisible as the grid grows/shrinks if (e.Item is GridFilteringItem) { GridFilteringItem Filter = (GridFilteringItem)e.Item; Filter["AgentID"].CssClass = "mediumgridcol"; Filter["AgentCellular"].CssClass = "smallgridcol"; Filter["AgentEmail"].CssClass = "smallgridcol"; } } protected void CreateNew_Click(object sender, EventArgs e) { Response.Redirect("OfcAgentEdit.aspx?M=N&K=&T=" + sType); } public DataTable GetDataTable() { String ConnString = System.Configuration.ConfigurationManager.ConnectionStrings["BrokerPlus"].ConnectionString; DataTable dt = new DataTable(); //string sStatusNeeded = ""; DateTime dt1 = Convert.ToDateTime("9/1/2014"); using (SqlConnection sqlcon = new SqlConnection(ConfigurationManager.ConnectionStrings["BrokerPlus"].ConnectionString)) { using (SqlCommand cmd = new SqlCommand("[Agents_GetAllByAgent_ExpiringLicenses2]", sqlcon)) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@Account", Convert.ToInt32(Session["UserAccount"]))); cmd.Parameters.Add(new SqlParameter("@Agent_Expire", dt1)); using (SqlDataAdapter da = new SqlDataAdapter(cmd)) { da.Fill(dt); return dt; } } } } protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) { RadGrid1.DataSource = GetDataTable(); } }}CREATE PROCEDURE [dbo].[Agents_GetAllByAgent_ExpiringLicenses2]( @Account int, @Agent_Expire date)ASSELECT Agent, AgentEmail, AgentID, AgentFullName, AgentCellular, AgentLicenseExpires, Agent_Account FROM AgentsWHERE AgentLicenseExpires < @Agent_Expire AND Agent_Account = @Account
