Hi.
We have a page with RadEditor placed into an iframe. Opening dialog when a size of dialog is bigger than the size of iframe looks not good (radwindow-dialog.png).
We tried to use browser modal dialog by calling client-side function set_useClassicDialogs(true). In this case, the popup dialog is smaller than the content and we need to scroll or maximize the window (browser-modal-dialog.png).
We use 2020.1.219.35 version.
Any suggestions to get auto-resized dialog over iframe would be much appreciated.

I have a landscape formated output directed to the PDF export from my RadGrid and the data has recently extended to a new page. Is there a way to scale to a single page? The below is what I'm using to setup the PDF prior to export.
grdScoreCardDashboard.ExportSettings.Pdf.BorderType = GridPdfSettings.GridPdfBorderType.AllBorders
grdScoreCardDashboard.ExportSettings.OpenInNewWindow = True
grdScoreCardDashboard.ExportSettings.IgnorePaging = True
grdScoreCardDashboard.ExportSettings.Pdf.PageHeight = Unit.Parse("162mm")
grdScoreCardDashboard.ExportSettings.Pdf.PageWidth = Unit.Parse("600mm")
grdScoreCardDashboard.ExportSettings.Pdf.PageRightMargin = Unit.Parse("5mm")
grdScoreCardDashboard.ExportSettings.Pdf.PageLeftMargin = Unit.Parse("5mm")
grdScoreCardDashboard.ExportSettings.Pdf.PageLeftMargin = Unit.Point(-1)
grdScoreCardDashboard.ExportSettings.Pdf.PageRightMargin = Unit.Point(-1)
grdScoreCardDashboard.ExportSettings.Pdf.PageTopMargin = Unit.Point(-2)
grdScoreCardDashboard.ExportSettings.Pdf.PageBottomMargin = Unit.Point(-2)
grdScoreCardDashboard.ExportSettings.Pdf.Title = "Score Card"
grdScoreCardDashboard.ExportSettings.Pdf.PaperSize = GridPaperSize.Letter
grdScoreCardDashboard.ExportSettings.FileName = String.Format("ScoreCardOutput-{0}", DateTime.Now.ToString("yyyyMMddhhmmss"))
grdScoreCardDashboard.ExportSettings.Pdf.AllowPrinting = True
grdScoreCardDashboard.ExportSettings.Pdf.AllowModify = True
grdScoreCardDashboard.ExportSettings.Pdf.AllowCopy = True
grdScoreCardDashboard.ExportSettings.ExportOnlyData = True
grdScoreCardDashboard.ExportSettings.Pdf.FontType = Telerik.Web.Apoc.Render.Pdf.FontType.Embed
grdScoreCardDashboard.Width = Unit.Percentage(100)
grdScoreCardDashboard.Height = Unit.Percentage(100)

I need a way of reset all entries from AutoCompleteBox including:
1) Remove all entries from the entries array; and
2) Remove all tokens from text box
I need to do this programmatically in server side code.
Thanks!

Not lucky getting RadGrid populated. I have a RadAutoCompleteBox where user can a code used as parameter of a stored procedure and the result should populate the grid in three columns. I tried to made it as simpler as possible but my grid is not showing up anything.
My code ASPX:
<form id="form1" runat="server"> <telerik:RadScriptManager runat="server" ID="RadScriptManager1" /> <telerik:RadAjaxManager ID="ajaxmanager1" runat="server" EnableAJAX="true"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RadAutoCompleteBox1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadAutoCompleteBox1" LoadingPanelID="radloadingpanel1" /> <telerik:AjaxUpdatedControl ControlID="lblOEValue" LoadingPanelID="radloadingpanel1" /> <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="radloadingpanel1" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="btnSearch"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadAutoCompleteBox1" LoadingPanelID="radloadingpanel1" /> <telerik:AjaxUpdatedControl ControlID="lblOEValue" LoadingPanelID="radloadingpanel1" /> <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="radloadingpanel1" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <telerik:RadAjaxLoadingPanel ID="radloadingpanel1" runat="server" AnimationDuration="0" InitialDelayTime="1000"> </telerik:RadAjaxLoadingPanel> <telerik:RadAutoCompleteBox runat="server" ID="RadAutoCompleteBox1" ClientID="RadAutoCompleteBox1" > <!-- I supressed details because auto complete box is working fine --> </telerik:RadAutoCompleteBox> <telerik:RadGrid ID="RadGrid1" runat="server" autopostback="true"> <MasterTableView AutoGenerateColumns="true"> <Columns> <telerik:GridBoundColumn DataField="Description" UniqueName="Description"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="ConditionsAndOptions" UniqueName="ConditionsAndOptions"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="RetailPrice" UniqueName="RetailPrice"> </telerik:GridBoundColumn> </Columns> </MasterTableView> </telerik:RadGrid> <asp:Button id="btnSearch" Text="Search" OnClick="btnSearch_Click" autopostback="true" runat="server"/><br /> <div style="display:none"> <asp:label ClientID="lblOEValue" id="lblOEValue" ClientIDMode="Static" autopostback="true" visible="true" runat="server" ></asp:label> </div></form>
My VB code:
Protected Sub RadAutoCompleteBox1_EntryAdded(sender As Object, e As Telerik.Web.UI.AutoCompleteEntryEventArgs) lblOEValue.Text = e.Entry.TextEnd SubProtected Sub RadAutoCompleteBox1_EntryRemoved(sender As Object, e As Telerik.Web.UI.AutoCompleteEntryEventArgs) lblOEValue.Text = ""End SubProtected Sub btnSearch_Click(sender As Object, e As EventArgs) Dim myConn As SqlConnection = New SqlConnection(ConfigurationManager.AppSettings("myconnection"))
Dim adapter As SqlDataAdapter = New SqlDataAdapter Dim myDataTable As New DataTable adapter.SelectCommand = New SqlCommand("EXEC [dbo].[] '" + lblOEValue.Text + "'", myConn) myConn.Open() adapter.Fill(myDataTable) RadGrid1.DataSource = myDataTable myConn.Close()
End Sub
What am I missing here?

Hi,
We've downloaded the latest version of the Telerik libraries - 2017.2.711.45 - and when we drop them into our web application we get the error
Error occurred during a cryptographic operation
with the stack trace pasted at the end of this message in our log files.
The error itself is pretty generic and suggested fixes include clearing the browser cache or tokens from the UserTokenCaches table. However, none of these solutions is working for us, so we've had to do a bit more digging.
What we've discovered is that this error is occuring on any page that uses the RadAsyncUpload control (we're not sure that it's only this control but other Telerik controls seem to be fine). It only happens with the 2017.2.711.45 libraries - if we copy back in the 2017.2.503.45 libraries our web application works again as normal.
We've tried recreating the problem in a simple web application but we can't and our real web application is far too complex to whittle down to demonstrable size.
Any help would be appreciated.
Stephen.
2017-09-01 15:49:08,552 [33] [Admin] [pftilg0judh5r3uukzo3cyew] [(null)] ERROR UI.Web.Global - Application_Error : Unhandled exception.
System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Security.Cryptography.CryptographicException: Error occurred during a cryptographic operation.
at System.Web.Security.Cryptography.HomogenizingCryptoServiceWrapper.HomogenizeErrors(Func`2 func, Byte[] input)
at System.Web.Security.Cryptography.HomogenizingCryptoServiceWrapper.Protect(Byte[] clearData)
at System.Web.Security.MachineKey.Protect(ICryptoServiceProvider cryptoServiceProvider, Byte[] userData, String[] purposes)
at System.Web.Security.MachineKey.Protect(Byte[] userData, String[] purposes)
at Telerik.Web.UI.CryptoService.EncryptWithMachineKey(String clearText)
at Telerik.Web.UI.CryptoService.Encrypt(String plainString)
at Telerik.Web.UI.RadAsyncUpload.DescribeComponent(IScriptDescriptor descriptor)
at Telerik.Web.UI.RadWebControl.Telerik.Web.IControl.DescribeComponent(IScriptDescriptor descriptor)
at Telerik.Web.UI.ScriptRegistrar.GetScriptDescriptors(Control control)
at Telerik.Web.UI.RadWebControl.GetScriptDescriptors()
at Telerik.Web.UI.RadWebControl.System.Web.UI.IScriptControl.GetScriptDescriptors()
at System.Web.UI.ScriptControlManager.RegisterScriptDescriptors(IScriptControl scriptControl)
at Telerik.Web.UI.RadWebControl.RegisterScriptDescriptors()
at Telerik.Web.UI.RadWebControl.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.Control.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.Control.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.Control.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.UpdatePanel.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.UpdatePanel.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at System.Web.UI.PageRequestManager.RenderFormCallback(HtmlTextWriter writer, Control containerControl)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer)
at System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer)
at System.Web.UI.HtmlFormWrapper.System.Web.UI.IHtmlForm.RenderControl(HtmlTextWriter writer)
at System.Web.UI.PageRequestManager.RenderPageCallback(HtmlTextWriter writer, Control pageControl)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.Page.Render(HtmlTextWriter writer)
at System.Web.UI.Adapters.ControlAdapter.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at Telerik.Web.UI.RadAjaxControl.RenderPageInAjaxMode(HtmlTextWriter writer, Control page)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.Page.Render(HtmlTextWriter writer)
at System.Web.UI.Adapters.ControlAdapter.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.members_framework_frameworklisting_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\vs\82ed21aa\e4b970d2\App_Web_mg1k0qrw.1.cs:line 0
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

I know there have been previous similar old threads to this but I still keep getting this error message
Doesn't come up all the time but stops the project from building and therefore you cant run it
it always refers to the same sub on multiple pages
Protected Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, ByVal e As Web.UI.AjaxRequestEventArgs)
various lines of code....
End Sub
And on the pages in question, in page load I have the following:
Dim manager As RadAjaxManager = RadAjaxManager.GetCurrent(Page)
AddHandler manager.AjaxRequest, AddressOf RadAjaxManager1_AjaxRequest
The project is running the latest extensions (2020.2.617) and i have been through the upgrade wizard
ANY HELP?
really starting to be a pain in the back side!
I have a RadGrid I'm exporting to excel but for cells with zeros it's not formating cell for Decimal with two places. I'm using the below to set the cell text and it works fine for Cell values other than Zero.
cell.Text = decValue.ToString("n2")

Hi!
I want to swap a RadGridView with a RadListView Control.
One issue I have at them moment is applying a filter to the RadListView.
Before (with RadGrid) I used:
Dim filterExpression As String
filterExpression = "(ProductID = " & drp_Products.SelectedValue.ToString & ")"
RadGrid_Search.MasterTableView.FilterExpression = filterExpression
RadGrid_Search.MasterTableView.Rebind()
How can I do the same thing with RadListVIew?
Thanks, Tom
Hi!
I have a tiny rotating animation (GIF) to tell my users to wait while data is being retrieved, so I need to show or hide it depending on the situation.
I would like to know if there is an appropriated Telerik container that I could use to put my GIF inside and control its visibility from code behind I tried to use a regular DIV but it is not showing/hiding accordingly.
Thanks!
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Templates/PortalBase.Master" CodeBehind="master_course_list.aspx.vb" Inherits="uo.FacultyPortal.web.course_filter" %><%@ Register Src="~/code/ucMessage.ascx" TagName="Message" TagPrefix="uc" %><asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="WorkPane" runat="server"> <telerik:RadGrid ID="rgCourseInventoryList" runat="server" CssClass="RadGrid" GridLines="None" AllowPaging="True" PageSize="10" AllowSorting="True" AutoGenerateColumns="False" ShowStatusBar="true" OnDetailTableDataBind="rgCourseInventoryList_DetailTableDataBind" OnNeedDataSource="rgCourseInventoryList_NeedDataSource"> <MasterTableView CommandItemDisplay="TopAndBottom" DataKeyNames="CourseId" AutoGenerateColumns="false" HierarchyLoadMode="ServerBind" HierarchyDefaultExpanded="true" ClientDataKeyNames="CourseId"> <CommandItemSettings AddNewRecordText="<%$ Resources:ui_messages, msgAddNewRecord %>" AddNewRecordImageUrl="../config/Images/Icons/addrecord.gif" RefreshText=""/> <CommandItemTemplate> <asp:ImageButton runat="server" ImageUrl="../config/Images/Icons/addrecord.gif" OnClientClick="return ShowInsertForm();" ID="ibInsertForm" ToolTip="<%$ Resources:ui_labels, ibShowDeleteForm %>"/> </CommandItemTemplate> <Columns> <telerik:GridEditCommandColumn EditImageUrl="../config/Images/Icons/edit.png" ButtonType="ImageButton" ItemStyle-Width="10px" EditText="<%$ Resources:ui_labels, ibEditCourse %>"> </telerik:GridEditCommandColumn> <telerik:GridTemplateColumn UniqueName="gtcShowDelete" ItemStyle-Width="10px"> <ItemTemplate> <asp:ImageButton runat="server" ImageUrl="../config/Images/Icons/delete.png" ID="ibShowDeleteForm" ToolTip="<%$ Resources:ui_labels, ibShowDeleteForm %>"/> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridBoundColumn UniqueName="CourseCode" HeaderText="<%$Resources:ui_labels, gbcCourseCode %>" DataField="SISCourseCode"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="CourseTitle" DataField="SISCourseTitle" Visible="false"> </telerik:GridBoundColumn> <telerik:GridTemplateColumn UniqueName="gtcTitle" HeaderText="<%$ Resources:ui_labels, gtcTitle %>" ItemStyle-VerticalAlign="Middle"> <ItemTemplate> <asp:Image ID="imgParent" runat="server" Visible="false" /> <asp:Label ID="lblParentTitle" runat="server"></asp:Label> <asp:Label ID="lblCourseTitle" runat="server"></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridBoundColumn UniqueName="CourseNote" HeaderText="<%$Resources:ui_labels, gbcNote %>" DataField="SISCourseNotes"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="CourseExpired" DataField="SISCourseExpired" Visible="false"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="ParentId" DataField="ParentId" Visible="false"> </telerik:GridBoundColumn> </Columns> <EditFormSettings EditFormType="Template"> <FormTableItemStyle width="100%"></FormTableItemStyle> <FormTableStyle GridLines="None" CellSpacing="0" CellPadding="2"></FormTableStyle> <FormStyle Width="100%" backColor="white"></FormStyle> <FormTemplate> <asp:Table ID="tblCourseDetails" CellSpacing="2" CellPadding="1" runat="server" BorderWidth="1" Width="100%"> <asp:TableRow runat="server" ID="trInternal"> <asp:TableCell runat="server" ID="tcInternal"> <asp:Table ID="tblInternal" runat="server"> <asp:TableRow ID="trMessageArea" runat="server"> <asp:TableCell ID="tcMessageArea" runat="server" colspan="2"> <uc:Message ID="msgMessageArea" runat="server" /> </asp:TableCell> </asp:TableRow> <asp:TableRow runat="server" ID="trCourseCode"> <asp:TableCell runat="server" ID="tcCourseCode"> <asp:Label runat="server" ID="lblCourseCode" Text="<%$ Resources:ui_labels, lblCourseCode %>"></asp:Label> </asp:TableCell> <asp:TableCell runat="server" ID="tcActivityCode2" HorizontalAlign="Left"> <asp:TextBox runat="server" ID="txtSISCourseCode"></asp:TextBox> <asp:Label runat="server" ID="lblCourseCodeMandatory" Text="<%$ Resources:ui_labels, lblMandatoryFlag %>" CssClass="Mandatory"></asp:Label> </asp:TableCell> </asp:TableRow> <asp:TableRow runat="server" ID="tr1"> <asp:TableCell runat="server" ID="tc1"> <asp:Label runat="server" ID="lblCourseCategory" Text="<%$ Resources:ui_labels, lblCourseCategory %>"></asp:Label> </asp:TableCell> <asp:TableCell runat="server" ID="tc2" HorizontalAlign="Left"> <telerik:RadComboBox runat="server" ID="rcbCourseCategory" ></telerik:RadComboBox> <asp:Label runat="server" ID="lblCourseCategoryMandatory" Text="<%$ Resources:ui_labels, lblMandatoryFlag %>" CssClass="Mandatory"></asp:Label> </asp:TableCell> </asp:TableRow> <asp:TableRow runat="server" ID="tr2"> <asp:TableCell runat="server" ID="tc3"> <asp:Label runat="server" ID="lblCourseType" Text="<%$ Resources:ui_labels, lblCourseType %>"></asp:Label> </asp:TableCell> <asp:TableCell runat="server" ID="tc4" HorizontalAlign="Left"> <telerik:RadComboBox runat="server" ID="rcbCourseType" ></telerik:RadComboBox> <asp:Label runat="server" ID="lblCourseTypeMandatory" Text="<%$ Resources:ui_labels, lblMandatoryFlag %>" CssClass="Mandatory"></asp:Label> </asp:TableCell> </asp:TableRow> <asp:TableRow runat="server" ID="tr3"> <asp:TableCell runat="server" ID="tc5"> <asp:Label runat="server" ID="lblLanguage" Text="<%$ Resources:ui_labels, lblLanguage %>"></asp:Label> </asp:TableCell> <asp:TableCell runat="server" ID="tc6" HorizontalAlign="Left"> <telerik:RadComboBox runat="server" ID="rcbLanguage" ></telerik:RadComboBox> <asp:Label runat="server" ID="lblLanguageMandatory" Text="<%$ Resources:ui_labels, lblMandatoryFlag %>" CssClass="Mandatory"></asp:Label> </asp:TableCell> </asp:TableRow> <asp:TableRow runat="server" ID="tr4"> <asp:TableCell runat="server" ID="tc7"> <asp:Label runat="server" ID="lblAcademicUnit" Text="<%$ Resources:ui_labels, lblAcademicUnit %>"></asp:Label> </asp:TableCell> <asp:TableCell runat="server" ID="tc8" HorizontalAlign="Left"> <telerik:RadComboBox runat="server" ID="rcbAcademicUnit" MarkFirstMatch="true" ></telerik:RadComboBox> <asp:Label runat="server" ID="lblAcademicUnitMandatory" Text="<%$ Resources:ui_labels, lblMandatoryFlag %>" CssClass="Mandatory"></asp:Label> </asp:TableCell> </asp:TableRow> <asp:TableRow runat="server" ID="tr5"> <asp:TableCell runat="server" ID="tc9"> <asp:Label runat="server" ID="lblNumberOfSessions" Text="<%$ Resources:ui_labels, lblNumberOfSessions %>"></asp:Label> </asp:TableCell> <asp:TableCell runat="server" ID="tc10" HorizontalAlign="Left"> <asp:TextBox runat="server" ID="txtNumberOfSessions"></asp:TextBox> </asp:TableCell> </asp:TableRow> <asp:TableRow runat="server" ID="tr6"> <asp:TableCell runat="server" ID="tc11"> <asp:Label runat="server" ID="lblNote" Text="<%$ Resources:ui_labels, lblNote %>"></asp:Label> </asp:TableCell> <asp:TableCell runat="server" ID="tc12" HorizontalAlign="Left"> <asp:TextBox runat="server" ID="txtNote" Wrap="true" TextMode="MultiLine" Rows="4" Columns="40"></asp:TextBox> </asp:TableCell> </asp:TableRow> <asp:TableRow runat="server" ID="trCrossListCourse"> <asp:TableCell runat="server" ID="tc13"> <asp:Label runat="server" ID="lblCrossListCourseId" Text="<%$ Resources:ui_labels, lblCrossListCourseId %>"></asp:Label> </asp:TableCell> <asp:TableCell runat="server" ID="tc14" HorizontalAlign="Left"> <asp:TextBox runat="server" ID="txtCrossListCourseCode"></asp:TextBox> </asp:TableCell> </asp:TableRow> <asp:TableRow runat="server" ID="tr8"> <asp:TableCell runat="server" id="tc15" HorizontalAlign="Left" ColumnSpan="2"> <asp:Button runat="server" ID="btnUpdate" Text="<%# IIf((TypeOf(Container) is GridEditFormInsertItem), Resources.ui_labels.btnAdd.ToString(), Resources.ui_labels.btnUpdate.ToString()) %>" CommandName='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "PerformInsert", "Update") %>' /> <asp:Button runat="server" ID="btnCancel" CausesValidation="false" CommandName="Cancel" Text="<%$ Resources:ui_labels, btnCancel %>" /> </asp:TableCell> </asp:TableRow> </asp:Table> </asp:TableCell> </asp:TableRow> </asp:Table> </FormTemplate> </EditFormSettings> <DetailTables> <telerik:GridTableView runat="server" DataKeyNames="ChildCourseId" Name="CrossListView" ClientDataKeyNames="ChildCourseId"> <Columns> <telerik:GridButtonColumn ImageUrl="~/config/Images/Icons/lnk_del.png" CommandName="Delete" Text="<%$ Resources:ui_messages, msgDeleteLink %>" UniqueName="gbDeleteLink" ButtonType="ImageButton" ItemStyle-Width="10px" ConfirmText="<%$ Resources:ui_messages, msgConfirmDelete %>" ConfirmDialogType="Classic"> </telerik:GridButtonColumn> <telerik:GridTemplateColumn UniqueName="gtcShowDelete" ItemStyle-Width="10px"> <ItemTemplate> <asp:Image runat="server" ImageUrl="~/config/Images/Icons/lnk_chld.png"/> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridBoundColumn UniqueName="SISCourseCode" DataField="SISCourseCode"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="SISCourseTitle" DataField="SISCourseTitle"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="SISCourseExpired" DataField="SISCourseExpired" Visible="false"> </telerik:GridBoundColumn> </Columns> </telerik:GridTableView> </DetailTables> </MasterTableView> <ClientSettings> <Selecting AllowRowSelect="true"></Selecting> <ClientEvents OnRowDblClick="RowDblClickEdit"></ClientEvents> </ClientSettings> </telerik:RadGrid>Imports Telerik.Web.UIImports uo.FacultyPortal.CourseOfferImports uo.FacultyPortal.AdminImports uo.FacultyPortal.CommonImports uo.FacultyPortal.Common.ConstantsPartial Class course_filter Inherits CultureManager Private cacheManager As New CacheManager Private admin As CD_Tables = New CD_Tables Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then bindRadComboBox(rcbAcademicUnit, "CD_Academic_Unit") bindRadComboBox(rcbCourseCategory, "CD_Course_Categories") End If End Sub ''' <summary> ''' Return a lst of courses to the user based on their selected criteria ''' </summary> ''' <param name="sender"></param> ''' <param name="e"></param> ''' <remarks></remarks> Protected Sub btnSearch_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnSearch.Click msgMessageArea.FlushMessages() If rcbAcademicUnit.SelectedIndex <= 0 Then msgMessageArea.AddMessage(Resources.ui_labels.lblAcademicUnit.ToString + Resources.ui_messages.errRequiredField.ToString, Constants.uoMessageType.ErrorType) Else rgCourseInventoryList.Rebind() rgCourseInventoryList.CurrentPageIndex = 0 End If End Sub Protected Sub rgCourseInventoryList_DetailTableDataBind(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridDetailTableDataBindEventArgs) Handles rgCourseInventoryList.DetailTableDataBind Dim oCourses As New Course Dim oCourseInventory As New DataTable Dim parentItem As GridDataItem = CType(e.DetailTableView.ParentItem, GridDataItem) If parentItem.Edit Then Return End If If e.DetailTableView.Name = "CrossListView" Then Dim courseId As Integer = CInt(parentItem.GetDataKeyValue("CourseId")) oCourseInventory = oCourses.getCrossListedCourses(courseId, IIf(cbShowDeleted.Checked, "Y", "N")) e.DetailTableView.DataSource = oCourseInventory End If End Sub ''' <summary> ''' Get the data for the grid ''' </summary> ''' <param name="source"></param> ''' <param name="e"></param> ''' <remarks></remarks> Protected Sub rgCourseInventoryList_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles rgCourseInventoryList.NeedDataSource Dim oCourses As New Course Dim oCourseInventory As New DataTable ' Dim a As Integer = rgCourseInventoryList.CurrentPageIndex If Not e.IsFromDetailTable Then 'andalso e.RebindReason <> GridRebindReason.InitialLoad Then If e.RebindReason <> GridRebindReason.InitialLoad Then oCourseInventory = oCourses.getCourseInventory(rcbAcademicUnit.SelectedValue, rcbCourseCategory.SelectedValue, IIf(cbShowDeleted.Checked, "Y", "N")) rgCourseInventoryList.DataSource = oCourseInventory End If End If End Sub ''' <summary> ''' If course is no longer offered then overstrike the course code and remove the delete icon ''' </summary> ''' <param name="source"></param> ''' <param name="e"></param> ''' <remarks></remarks> Protected Sub rgCourseInventory_ItemDataBound(ByVal source As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles rgCourseInventoryList.ItemDataBound Dim dataItem As GridDataItem Dim headerItem As GridHeaderItem If TypeOf (e.Item) Is GridDataItem AndAlso e.Item.OwnerTableView.Name = "CrossListView" Then dataItem = CType(e.Item, GridDataItem) If dataItem("SISCourseExpired").Text <> " " Then CType(dataItem("gbDeleteLink").Controls(0), ImageButton).Visible = False dataItem("SISCourseCode").Font.Strikeout = True End If e.Item.OwnerTableView.ShowHeader = False End If If TypeOf (e.Item) Is GridDataItem AndAlso e.Item.OwnerTableView.NamingContainer.ID = "rgCourseInventoryList" Then dataItem = CType(e.Item, GridDataItem) If dataItem("CourseExpired").Text <> " " Then CType(e.Item.FindControl("ibShowDeleteForm"), ImageButton).Visible = False dataItem("CourseCode").Font.Strikeout = True End If Dim a As String = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("CourseId") If dataItem("ParentId").Text <> " " Then CType(e.Item.FindControl("ibShowDeleteForm"), ImageButton).Visible = False CType(dataItem.FindControl("imgParent"), Image).ImageUrl = "../Images/Icons/lnk.png" CType(dataItem.FindControl("imgParent"), Image).Visible = True If dataItem("CourseExpired").Text <> " " Then CType(dataItem.FindControl("lblParentTitle"), Label).Text = "(" + dataItem("ParentId").Text + ")" CType(dataItem.FindControl("lblParentTitle"), Label).Font.Strikeout = True CType(dataItem.FindControl("lblCourseTitle"), Label).Text = "<br>" + dataItem("CourseTitle").Text Else CType(dataItem.FindControl("lblCourseTitle"), Label).Text = "(" + dataItem("ParentId").Text + ")" + "<br>" + dataItem("CourseTitle").Text End If Else CType(dataItem.FindControl("lblCourseTitle"), Label).Text = dataItem("CourseTitle").Text End If ElseIf TypeOf (e.Item) Is GridHeaderItem Then headerItem = CType(e.Item, GridHeaderItem) ' headerItem End If End Sub ''' <summary> ''' Take action depending on what type of item it is. ''' </summary> ''' <param name="source"></param>) ''' <param name="e"></param> ''' <remarks></remarks> Protected Sub rgCourseInventory_ItemCreated(ByVal source As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles rgCourseInventoryList.ItemCreated Dim courseId As String Dim rcb As New RadComboBox Dim oCourses As New Course If TypeOf e.Item Is GridEditFormItem And e.Item.IsInEditMode Then bindRadComboBox(CType(e.Item.FindControl("rcbCourseCategory"), RadComboBox), "CD_Course_Categories") bindRadComboBox(CType(e.Item.FindControl("rcbCourseType"), RadComboBox), "CD_Course_Types") bindRadComboBox(CType(e.Item.FindControl("rcbLanguage"), RadComboBox), "CD_Course_Languages") bindRadComboBox(CType(e.Item.FindControl("rcbAcademicUnit"), RadComboBox), "CD_Academic_Unit") ' Are we editing an existing row? If e.Item.ItemIndex >= 0 Then ' Then get the course details from the DB and bind the values to the list boxes. courseId = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("CourseId") oCourses.getCourseDetails(courseId) ' Hide the course code if we're editing. Only see it on a create. CType(e.Item.FindControl("trCourseCode"), TableRow).Visible = False CType(e.Item.FindControl("txtSISCourseCode"), TextBox).Text = oCourses.SISCourseCode CType(e.Item.FindControl("rcbCourseCategory"), RadComboBox).SelectedValue = oCourses.CourseCategoryId CType(e.Item.FindControl("rcbCourseType"), RadComboBox).SelectedValue = oCourses.CourseTypeId CType(e.Item.FindControl("rcbLanguage"), RadComboBox).SelectedValue = oCourses.CourseLanguageId CType(e.Item.FindControl("rcbAcademicUnit"), RadComboBox).SelectedValue = oCourses.AcademicUnitId CType(e.Item.FindControl("txtNumberOfSessions"), TextBox).Text = oCourses.NumberOfSessions CType(e.Item.FindControl("txtNote"), TextBox).Text = oCourses.Note If Not oCourses.CrossListCourseCode Is Nothing Then CType(e.Item.FindControl("trCrossListCourse"), TableRow).Visible = False End If End If ElseIf TypeOf e.Item Is GridDataItem Then If e.Item.OwnerTableView.NamingContainer.ID = "rgCourseInventoryList" Then Dim clr As String = e.Item.Style("backgroundColor") e.Item.Attributes.Add("onmouseover", "this.style.backgroundColor='lightsteelblue';this.style.cursor='hand';") e.Item.Attributes.Add("onmouseout", "this.style.backgroundColor='" & clr & "';this.style.cursor='';") Dim deleteForm As ImageButton = DirectCast(e.Item.FindControl("ibShowDeleteForm"), ImageButton) deleteForm.Attributes("onclick") = [String].Format("return ShowDeleteForm('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("CourseId"), e.Item.ItemIndex) ElseIf e.Item.OwnerTableView.Name = "CrossListView" Then Dim clr As String = e.Item.Style("backgroundColor") e.Item.Attributes.Add("onmouseover", "this.style.backgroundColor='#cc99ff';this.style.cursor='hand';") e.Item.Attributes.Add("onmouseout", "this.style.backgroundColor='" & clr & "';this.style.cursor='';") End If End If If TypeOf e.Item Is GridDataItem Then End If End Sub ''' <summary> ''' Hide the empty rows in child gridview ''' </summary> ''' <param name="sender"></param> ''' <param name="e"></param> ''' <remarks></remarks> Protected Sub rgCourseInventoryList_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles rgCourseInventoryList.PreRender HideExpandColumnRecursive(rgCourseInventoryList.MasterTableView) End Sub ''' <summary> ''' Recursively loop through grid looking for empty chidren and suppress the "No records found message" and the row. ''' </summary> ''' <param name="tableView"></param> ''' <remarks></remarks> Private Sub HideExpandColumnRecursive(ByVal tableView As GridTableView) Dim nestedViewItems As GridItem() = tableView.GetItems(GridItemType.NestedView) For Each nestedViewItem As GridNestedViewItem In nestedViewItems For Each nestedView As GridTableView In nestedViewItem.NestedTableViews If nestedView.Items.Count = 0 Then Dim cell As TableCell = nestedView.ParentItem("ExpandColumn") cell.Controls(0).Visible = False nestedViewItem.Visible = False End If If nestedView.HasDetailTables Then HideExpandColumnRecursive(nestedView) End If Next Next End SubEnd ClassOption Strict OnImports System.DataImports uo.DataImports log4netImports uo.FacultyPortalImports uo.FacultyPortal.CommonImports System.GlobalizationImports System.Threading.ThreadImports System.TextPublic Class Course Public Function getCrossListedCourses(ByVal iCourseId As Integer, ByVal iShowDeleted As String) As DataTable Dim oCourseCrossList As DataSet Dim oGetCourseSchedule As XmlCallWrapper Try oGetCourseSchedule = XmlDatabase.CreateCallWrapper("FACULTYPORTAL", "PKG_COURSES.GET_CROSS_LISTED_COURSES_PRC") oGetCourseSchedule("PN_COURSE_ID") = iCourseId ' TODO need to get language id oGetCourseSchedule("PV_SHOW_EXPIRED") = iShowDeleted oGetCourseSchedule("PN_INTERFACE_LANG_ID") = 1 oGetCourseSchedule.Execute() oCourseCrossList = oGetCourseSchedule.GetDataSet oCourseCrossList.Tables("PC_RESULT").Columns(0).ColumnName = "ChildCourseId" oCourseCrossList.Tables("PC_RESULT").Columns(1).ColumnName = "SISCourseCode" oCourseCrossList.Tables("PC_RESULT").Columns(2).ColumnName = "SISCourseTitle" oCourseCrossList.Tables("PC_RESULT").Columns(3).ColumnName = "SISCourseExpired" Catch ex As Exception ' log error _logger.Error(ex) Finally End Try Return oCourseCrossList.Tables("PC_RESULT") End Function Public Function getCourseInventory(ByVal iAcademicUnit As Integer, ByVal iCourseCategory As Integer, ByVal iShowDeleted As String) As DataTable Dim oCourseSchedule As DataSet Dim oGetCourseSchedule As XmlCallWrapper Try oGetCourseSchedule = XmlDatabase.CreateCallWrapper("FACULTYPORTAL", "PKG_COURSES.GET_COURSES_BY_UNIT_PRC") oGetCourseSchedule("PN_ACADEMIC_UNIT_ID") = iAcademicUnit oGetCourseSchedule("PN_COURSE_CATEGORY_ID") = IIf(iCourseCategory = 0, DBNull.Value, iCourseCategory) oGetCourseSchedule("PV_SHOW_EXPIRED") = iShowDeleted ' TODO - Need to pass in or get the language oGetCourseSchedule("PN_INTERFACE_LANG_ID") = 1 oGetCourseSchedule.Execute() oCourseSchedule = oGetCourseSchedule.GetDataSet oCourseSchedule.Tables("PC_RESULT").Columns(0).ColumnName = "CourseId" oCourseSchedule.Tables("PC_RESULT").Columns(1).ColumnName = "SISCourseCode" oCourseSchedule.Tables("PC_RESULT").Columns(2).ColumnName = "SISCourseTitle" oCourseSchedule.Tables("PC_RESULT").Columns(3).ColumnName = "SISCourseNotes" oCourseSchedule.Tables("PC_RESULT").Columns(4).ColumnName = "SISCourseExpired" oCourseSchedule.Tables("PC_RESULT").Columns(5).ColumnName = "ParentId" Catch ex As Exception ' log error _logger.Error(ex) Finally End Try Return oCourseSchedule.Tables("PC_RESULT") End Function Public Sub getCourseDetails(ByVal iCourseId As Integer) Dim oCourseDetails As DataSet Dim oGetCourseDetails As XmlCallWrapper Try oGetCourseDetails = XmlDatabase.CreateCallWrapper("FACULTYPORTAL", "PKG_COURSES.GET_COURSE_DETAILS_PRC") oGetCourseDetails("PN_COURSE_ID") = iCourseId oGetCourseDetails.Execute() oCourseDetails = oGetCourseDetails.GetDataSet CourseCategoryId = CInt(oCourseDetails.Tables("PC_RESULT")(0).Item("COURSE_CATEGORY_ID")) CourseTypeId = CInt(oCourseDetails.Tables("PC_RESULT")(0).Item("COURSE_TYPE_ID")) CourseLanguageId = CInt(oCourseDetails.Tables("PC_RESULT")(0).Item("LANGUAGE_ID")) SISCourseCode = oCourseDetails.Tables("PC_RESULT")(0).Item("SIS_ACAD_ACT_CD").ToString AcademicUnitId = CInt(oCourseDetails.Tables("PC_RESULT")(0).Item("UNIT_ID")) NumberOfSessions = oCourseDetails.Tables("PC_RESULT")(0).Item("REG_SESSION_COUNT").ToString Note = oCourseDetails.Tables("PC_RESULT")(0).Item("NOTE").ToString CrossListCourseCode = CStr(oCourseDetails.Tables("PC_RESULT")(0).Item("CROSS_LIST_COURSE_ID")) Catch ex As Exception ' log error _logger.Error(ex) Finally End Try End SubEnd Class