Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
353 views
Hello all, 

I have a problem to show AjaxLoadingPanel when loading report in SSRS ReportViewer. I created a simple webpage that contains only one button and one report viewer control. OnClick event of the button, I load the report. It working properly without AjaxManager.
With AjaxManager, I ended with this error message: "Uncaught Sys.InvalidOperationException: Sys.InvalidOperationException: Could not find UpdatePanel with ID 'rptViewer_ReportViewer'. If it is being updated dynamically then it must be inside another UpdatePanel."

I need to use AjaxManager as I need to show loading panel while report was generating. Following is the markup of my page.
<form id="form1" runat="server">
    <%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"
        Namespace="Microsoft.Reporting.WebForms" TagPrefix="rvweb" %>
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" EnablePartialRendering="true">
    </telerik:RadScriptManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadSkinManager ID="radSkinManager1" runat="server" Skin="WebBlue"></telerik:RadSkinManager>
    <telerik:RadAjaxManager ID="ajaxMgr1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="pnlMain">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlMain" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <div>
        <asp:Panel ID="pnlMain" runat="server" Style="height: 100vh;">
            <asp:Button ID="btnViewReport" runat="server" Text="View" OnClick="btnViewReport_Click" />
            <hr />
            <rvweb:ReportViewer ID="rptViewer" runat="server" AsyncRendering="false" Height="100%" Width="100%"
                ProcessingMode="Remote" ShowZoomControl="false" SizeToReportContent="true" CssClass="reportBody"
                PageCountMode="Actual" ShowPrintButton="true" ExportContentDisposition="AlwaysInline">
            </rvweb:ReportViewer>
        </asp:Panel>
    </div>
</form>

FYI: In my real project, asp:Panel (pnlMain) is the wrapper of Master Page ContentPlaceHolder. My main intention is to show loading panel on every postback of the whole project.

Please advice.

Thanks in advanced,
Robin
Viktor Tachev
Telerik team
 answered on 25 Mar 2015
3 answers
209 views
Hi Guys

I wonder if you can help, I can not seem to find anyone whos had theis problem!

So I have a Radlist view and 2 x rad data pagers on a control. I have page size enabled, this diaplays a dropdwn list of page sizes: 5, 10, 20, 50.

By default the page size is 10, and onload everything works fine and 10 items are displayed.

When I change page size to "20" using the dropdown list, this also works and 20 items are displayed.

However, when I try and change page size for the SECOND time, I always get an error: 

Collection was modified after the enumerator was instantiated.

Here is my code:

Control .ascx code...

 

 

 

 

<%

 

@ Control Language="VB" AutoEventWireup="false" CodeFile="FileTileview.ascx.vb" Inherits="Modules_DAM_v3_Controls_FileTileview" %>

 

 

<%

 

@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

 

 <

 

 script type="text/javascript" src="Controls/jscript/FileList.js">

 

</

 

 

script>

 

 

 

<telerik:RadDataPager ID="RadDataPagerAssetsTop" runat="server" PagedControlID="RadListView1" Skin="Default" enableViewstate="false" >

 

<Fields> 

 

 

 

<telerik:RadDataPagerButtonField FieldType="FirstPrev" />  

 

 

 

<telerik:RadDataPagerButtonField FieldType="Numeric" />

 

<telerik:RadDataPagerButtonField FieldType="NextLast" />

 

<telerik:RadDataPagerPageSizeField PageSizeText="Page size:" /> 

 

<telerik:RadDataPagerTemplatePageField HorizontalPosition="RightFloat">  

 

 

 

<PagerTemplate 

 

 

 

<b>

Items <asp:Label runat="server" ID="TotalItemsLabel" Text="<%# Container.Owner.TotalRowCount%>"/>

 

 

 

<br />

</b 

 

</PagerTemplate>

 

</telerik:RadDataPagerTemplatePageField 

 

</Fields> </telerik:RadDataPager>

 

<div class="clear"></div>

 

<telerik:RadListView ID="RadListView1" runat="server" AllowPaging="True" PageSize="10" ItemPlaceholderID="ProductsHolder" DataKeyNames="FileId" AllowCustomPaging="false"  

 

 

 

<ItemTemplate>

 

<div class="smallThumbnail">  

 

 

 

<div class="smallThumbnailcontent">  

 

 

 

<div class="image">

 

<asp:ImageButton ID="imgThumb" runat="server" CssClass="asset_image" CommandName="Preview" />

 

</div 

 

<div class="detail">  

 

 

 

<asp:Literal ID="ltlDetails" runat="server"></asp:Literal 

 

 

 

<asp:Label ID="lblDetails" runat="server"></asp:Label>

 

</div 

 

<div class="buttons">

 

<asp:imageButton ID="btndownload" runat="server" Text="download" CommandName="Download" CommandArgument

="FileId"/>  

 

 

 

<asp:imageButton ID="btnFileInfo" runat="server" Text="Info" CommandName="FileInfo"/>  

 

 

 

<asp:imageButton ID="btnPreview" runat="server" Text="Preview" CommandName="Preview"/>

 

<asp:imageButton ID="btnFileMgt" runat="server" Text="Mgt" CommandName="FileMgt"/>

<asp:LinkButton ID="lnkbtnPath" runat="server" CommandName="PathLink"></asp:LinkButton>

 

</div>

 

<asp:HiddenField ID="hfProductId" runat="server" />  

 

 

 

</div 

 

 

 

</div 

 

 

 

</ItemTemplate>

 

<LayoutTemplate>

<asp:Panel ID="ProductsHolder" runat="server" />  

 

 

 

</LayoutTemplate 

 

 

 

</telerik:RadListView>

<div class="clear"></div 

 

<telerik:RadDataPager ID="RadDataPagerAssetsBottom" runat="server" PagedControlID="RadListView1" Skin="Default">

 

<Fields>

 

<telerik:RadDataPagerButtonField FieldType="FirstPrev" />  

 

<telerik:RadDataPagerButtonField FieldType="Numeric" />

 

<telerik:RadDataPagerButtonField FieldType="NextLast" />

 

<telerik:RadDataPagerPageSizeField PageSizeText="Page size: " />

 

<telerik:RadDataPagerTemplatePageField HorizontalPosition="RightFloat">   

 

 

 

<PagerTemplate 

 

 

 

<b>Items

 

<asp:Label runat="server" ID="Label1" Text="<%# Container.Owner.TotalRowCount%>" />  

 

<br />  

 

 

 

</b>

 

 

</PagerTemplate>

 

</telerik:RadDataPagerTemplatePageField>
</Fields>

 

</telerik:RadDataPager>

Code behind...
#Region

 

 

 

"Public Properties"

 

 

 

 

 

Protected Property _FolderId() As

Integer

 

 

 

 

Get

 

 

 

Return ViewState(ID.ToString & "_FolderId"

)

 

End

Get

 

Set(ByVal value As Integer

)

 

 

 

ViewState(ID.ToString &

 

"_FolderId" ) = value

 

 

 

 

 

End

Set

 

 

 

 

End

Property

 

 

 

 

 

'Only used for PortalDI

 

  

Protected Property _FolderPath() As

String

 

 

 

 

 

 

 

 

Get

 

 

 

Return ViewState(ID.ToString & "_FolderPath"

)

 

 

 

End

Get

 

Set(ByVal value As String

)

 

ViewState(ID.ToString &

 

"_FolderPath" ) = value

 

 

 

 

 

End

Set

 

End

Property

 

 

 

 

Protected Property _ParentId() As

Integer

 

 

 

Get

 

 

 

Return ViewState(ID.ToString & "_ParentId" )

 

 

 

 

End

Get

 

 

 

 

 

 

Set(ByVal value As Integer )

 

 

 

 

 

ViewState(ID.ToString &

 

"_ParentId" ) = value

 

 

 

 

 

End

Set

 

 

 

  

End

Property

 

 

 

 

#End Region

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Public Sub

SearchFiles()

 

 

 

 

 

ResetRadListPageIndex()

 

 

 

 

 

 

 

 

 

 

 

 

'Need to build the initial datatable first

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

BuildDataTable()

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


Dim
x As New ServiceRefAssets.

FileServiceClient

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Dim y = x.GetSearch1FilesOneChildDown(AssetUser.UsernameAssetMgt, AssetUser.PasswordAssetMgt, _FolderPath, 100, False

)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

'Build the data table from object

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ObjectToFileDatatable(y)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

'Databind data to RadGrid

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DatabindListView()

 

 

 

 

 

 

 

 

 

 

 

End

If

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

End

Sub

 

 

 

 

 

 

 

 

 

 

 

Protected Sub

BuildDataTable()

 

 

 

 

 

 

 

 

 

 

 

 

 

 

'Builds a table of all files and folders

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

'Start with a clean table

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

dt.Clear()

 

 

 

 

 

 

 

 

 

 

 

 

'Generic Columns Index Number

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

dt.Columns.Add(

 

 

 

 

 

 

 

"IsFolder")

'0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

'Folder specific

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

dt.Columns.Add(

 

 

 

 

 

 

 

"FolderId")

'1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

dt.Columns.Add(

 

 

 

 

 

 

 

"ParentId")

'2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

dt.Columns.Add(

 

 

 

 

 

 

 

"FolderName")

'3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

'dt.Columns.Add("FolderValue") '4

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

dt.Columns.Add(

 

 

 

 

 

 

 

"FolderPath")

'4

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

dt.Columns.Add(

 

 

 

 

 

 

 

"FolderDeleted")

'5

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

'File Specific

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

dt.Columns.Add(

 

 

 

 

 

 

 

"FileId")

'6

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

dt.Columns.Add(

 

 

 

 

 

 

 

"FileName")

'7

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

dt.Columns.Add(

 

 

 

 

 

 

 

"FileType")

'8

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

dt.Columns.Add(

 

 

 

 

 

 

 

"FileExtension")

'9

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

dt.Columns.Add(

 

 

 

 

 

 

 

"FileSize")

'10

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

dt.Columns.Add(

 

 

 

 

 

 

 

"Title")

'11

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

dt.Columns.Add(

 

 

 

 

 

 

 

"Description")

'12

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

dt.Columns.Add(

 

 

 

 

 

 

 

"Deleted")

'13

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

dt.Columns.Add(

 

 

 

 

 

 

 

"FileInfo")

'14

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

'CreateFolderUp()

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

End

Sub

 

 

 

 

 

 

 

 

 

 

 

Protected Sub ObjectToFileDatatable(ByVal obj As Object

)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

'Build up the data table

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

For Each i As ServiceRefAssets.File In

obj.Files

 

 

 

 

 

dr = dt.NewRow

 

 

 

 

 

 

 

 

 

 

 

 

'Generic Columns

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

dr.Item(

 

 

 

 

 

 

 

"IsFolder") =

"False"

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

'File Specific

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

dr.Item(

 

 

 

 

 

 

 

"FileId"

) = i.Id

 

 

 

 

 

dr.Item(

 

 

 

 

 

 

 

"FileName"

) = i.Name

 

 

 

 

 

dr.Item(

 

 

 

 

 

 

 

"FileType"

) = i.Type

 

 

 

 

 

dr.Item(

 

 

 

 

 

 

 

"FileExtension"

) = i.Type

 

 

 

 

 

dr.Item(

 

 

 

 

 

 

 

"FileSize"

) = i.Length

 

 

 

 

 

dr.Item(

 

 

 

 

 

 

 

"Title"

) = i.Name

 

 

 

 

 

dr.Item(

 

 

 

 

 

 

 

"Description") = ""

'i.CreatedDate ' "" 'ByteToString(i.Image)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

dr.Item(

 

 

 

 

 

 

 

"Deleted") =

False

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

'Folder Specific

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

dr.Item(

 

 

 

 

 

 

 

"FolderId"

) = i.Id

 

 

 

 

 

dr.Item(

 

 

 

 

 

 

 

"FolderName"

) = i.Name

 

 

 

 

 

dr.Item(

 

 

 

 

 

 

 

"FolderPath"

) = i.Path

 

 

 

 

 

dr.Item(

 

 

 

 

 

 

 

"FolderDeleted") =

False

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

dr.Item(

 

 

 

 

 

 

 

"FileInfo") = ""

'getFileInfo(i)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

dt.Rows.Add(dr)

 

 

 

 

 

 

 

 

 

 

 

 

Next

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


End

Sub

 

 

 

 

 

 

 

 

 

 

 

Public Sub DatabindListView(Optional ByVal dtbl As DataTable = Nothing

)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

'Databind data to RadGrid

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

If dtbl Is Nothing

Then

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

'Get current page as using current DB of assets

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RadListView1.CurrentPageIndex = SelectedPage

 

 

 

 

 

 

 

 

 

 

 

 

Else

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FileColdtbl = dtbl

 

 

 

RadListView1.VirtualItemCount = dtbl.Rows.Count

 

 

 

 

 

 

 

 

 

 

 

 

'For Searching, used to work out what page num the asset is on

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

End

If

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RadListView1.DataSource = FileColdtbl

 

 

 

RadListView1.DataBind()

 

 

 

 

 

 

 

 

 

 

 

End

Sub

 

 

 

 

 

 

 

 

 

 

 

Protected Sub

ResetRadListPageIndex()

 

 

 

 

 

RadListView1.CurrentPageIndex = 0

 

 

 

 

 

 

 

 

 

 

 

End

Sub

 

 

 

 

 

 

 

 

 

 

 

 

Protected Sub RadListView1_PageIndexChanged(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadListViewPageChangedEventArgs) Handles

RadListView1.PageIndexChanged

 

 

 

 

 

RadListView1.DataSource = FileColdtbl

 

 

 

RadListView1.DataBind()

 

 

 

 

 

 

 

 

 

 

 

RaiseEvent

pageChanged()

 

 

 

 

 

 

 

 

 

 

 

 

 

End

Sub

 

 

 

 

 

 

 

 

 

 

 

Protected Sub RadListView1_PageSizeChanged(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadListViewPageSizeChangedEventArgs) Handles

RadListView1.PageSizeChanged

 

 

 

 

 

 

RadListView1.DataSource = FileColdtbl

 

 

RadListView1.DataBind()

 

 

 

 

 

 

 

 

 


End

Sub

 

 

 

 

 

 

 

 

 

 

 

 

Protected Sub RadDataPagerAssetsTop_PageIndexChanged(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadDataPagerPageIndexChangeEventArgs) Handles

RadDataPagerAssetsTop.PageIndexChanged

 

 

 

 

 

 

 

 

 

 

 

 

 

If e IsNot Nothing

Then

 

 

 

 

 

 

SelectedPage =

 

 

 

 

 

CInt

(e.NewPageIndex.ToString)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Else

 

 

 

 

 

 

SelectedPage = 0

 

 

 

 

 

 

 

 

 

End

If

 

 

 

 

 

 

 

 

 

 

 

 

End

Sub

 

 

 

 

 

 

 

 

 

 

 

 

Protected Sub RadDataPagerAssetsBottom_PageIndexChanged(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadDataPagerPageIndexChangeEventArgs) Handles

RadDataPagerAssetsBottom.PageIndexChanged

 

 

 

 

 

SelectedPage =

 

 

 

 

 

 

 

CInt

(e.NewPageIndex.ToString)

 

 

 

 

 

 

 

 

 

 

 

 

 

End

Sub

 

 

 

 

 

 

 

 

 

 

 

Protected Sub RadListView1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadListViewItemEventArgs) Handles

RadListView1.ItemDataBound

 

 

 

 

 

 

 

 

 

 

 

 

 

 

'****************************

 

 

 

 

 

 

 

 

 

 

 

 

 

'For Creating download path for 2 x image buttons below

 

 

 

 

 

 

 

 

 

 

 

 

Dim DefaultServerPath As String

= Instance.RootFolderPath

 

 

 

 

 

 

 

 

 

 

 

 

 

Dim FolderPath As String =

""

 

 

 

 

 

 

 

 

 

 

 

 

Dim FullFolderPath As String =

""

 

 

 

 

 

 

 

 

 

 

 

 

Dim FileConfirm As String =

"true"

 

 

 

 

 

 

 

 

 

 

 

 

 

'****************************

 

 

 

 

 

 

 

 

 

 

 

 

Dim RadDataItem As

RadListViewDataItem

 

 

 

 

 

 

RadDataItem = e.Item

 

 

 

 

 

 

 

 

 

Dim item As System.Data.

DataRowView

 

 

 

 

 

 

item = RadDataItem.DataItem

 

 

 

 

 

 

 

 

 

Dim lblDetails As Label = DirectCast(e.Item.FindControl("lblDetails"), Label

)

 

 

 

 

 

 

 

 

 

 

 

 

 

Dim ImgBtfolderFiles As ImageButton = DirectCast(e.Item.FindControl("imgThumb"), ImageButton

)

 

 

 

 

 

 

 

 

 

 

 

 

 

Dim litFileName As Literal = DirectCast(e.Item.FindControl("litFileName"), Literal

)

 

 

 

 

 

 

 

 

 

 

 

 

 

Dim litFileType As Literal = DirectCast(e.Item.FindControl("litFileType"), Literal

)

 

 

 

 

 

 

 

 

 

 

 

 

 

Dim ImgBtnDownload As ImageButton = DirectCast(e.Item.FindControl("btndownload"), ImageButton

)

 

 

 

 

 

 

 

 

 

 

 

 

 

Dim ImgBtnInfo As ImageButton = DirectCast(e.Item.FindControl("btnFileInfo"), ImageButton

)

 

 

 

 

 

 

 

 

 

 

 

 

 

Dim ImgBtnPreview As ImageButton = DirectCast(e.Item.FindControl("btnPreview"), ImageButton

)

 

 

 

 

 

 

 

 

 

 

 

 

 

Dim lnkbtnPath As LinkButton = DirectCast(e.Item.FindControl("lnkbtnPath"), LinkButton

)

 

 

 

 

 

 

 

 

 

 

 

 

 

Dim ImgBtnFileMgt As ImageButton = DirectCast(e.Item.FindControl("btnFileMgt"), ImageButton

)

 

 

 

 

 

 

 

 

 

 

 

 

 

Dim ImageThumbPath As String = String

.Empty

 

 

 

 

 

 

 

 

 

 

 

 

 

Dim NodeValue As String =

""

 

 

 

 

 

 

 

 

 

 

 

 

Dim RadTreeClientId As String =

"ctl00_MainContent_FileTree1_RadTreeView1"

 

 

 

 

 

 

 

 

 

 

 

 

 

''for thumb to full image view - jquery

 

 

 

 

 

 

 

 

 

 

 

 

 

'Dim hires As HtmlAnchor = DirectCast(e.Item.FindControl("hires"), HtmlAnchor)

 

 

 

 

 

 

 

 

 

 

 

 

 

'Dim lowres As HtmlImage = DirectCast(e.Item.FindControl("lowres"), HtmlImage)

 

 

 

 

 

 

 

 

 

 

 

 

 

''Keyword info

 

 

 

 

 

 

 

 

 

 

 

 

 

'Dim imgKeywordsBtn As ImageButton

 

 

 

 

 

 

 

 

 

 

 

 

 

'imgKeywordsBtn = DirectCast(e.Item.FindControl("imgKeywords"), ImageButton)

 

 

 

 

 

 

 

 

 

 

 

 

 

'Dim labelInfoDiv As Label

 

 

 

 

 

 

 

 

 

 

 

 

 

'labelInfoDiv = DirectCast(e.Item.FindControl("infoDiv"), Label)

 

 

 

 

 

 

 

 

 

 

 

 

 

'imgKeywordsBtn.Attributes.Add("onMouseOver", "toggleDiv('" & labelInfoDiv.ClientID & "',1)")

 

 

 

 

 

 

 

 

 

 

 

 

 

'imgKeywordsBtn.Attributes.Add("onMouseOut", "toggleDiv('" & labelInfoDiv.ClientID & "',0)")

 

 

 

 

 

 

 

 

 

 

 

 

 

'imgKeywordsBtn.Style.Add("cursor", "help")

 

 

 

 

 

 

 

 

 

 

 

 

 

'imgKeywordsBtn.Style.Add("padding", "4px")

 

 

 

 

 

 

 

 

 

 

 

 

 

'imgKeywordsBtn.ImageUrl = "./Images/info.png"

 

 

 

 

 

 

lblDetails.Text = DNA.Web.Helper.

 

 

 

 

 

AssetsHelper

.CreateDetailTable(RadDataItem)

 

 

 

 

 

lblDetails.ToolTip = item.Item(3).ToString

 

 

 

 

 

 

 

 

 

 

 

 

'Asset function Buttons

 

 

 

 

 

 

ImgBtnDownload.ImageUrl = imagePath2 +

 

 

 

 

 

 

"download_icon.png"

 

 

 

 

 

 

ImgBtnDownload.ToolTip =

 

 

 

 

 

 

"Download High Res"

 

 

 

 

 

 

 

 

 

 

 

 

 

'ImgBtnDownload.CommandArgument = item.Item(1)

 

 

 

 

 

 

ImgBtnDownload.Attributes.Add(

 

 

 

 

 

"onClick", "OnClientFileOpenWebNative('" + item.Item(1).ToString + "','" + item.Item(3).ToString + "','" + FileConfirm + "')"

)

 

 

 

 

 

ImgBtnInfo.ImageUrl = imagePath2 +

 

 

 

 

 

 

 

 

"information_icon.png"

 

 

 

 

 

 

ImgBtnInfo.ToolTip =

 

 

 

 

 

 

"Information"

 

 

 

 

 

 

ImgBtnInfo.CommandArgument = item.Item(1)

 

 

 

ImgBtnPreview.ImageUrl = imagePath2 +

 

 

 

 

 

 

"zoom_icon.png"

 

 

 

 

 

 

ImgBtnPreview.ToolTip =

 

 

 

 

 

 

"Preview"

 

 

 

 

 

 

ImgBtnPreview.CommandArgument = item.Item(1)

 

 

 

 

 

 

 

 

 

 

'hires.href = "~/Modules/DAM/V3/Images/image.aspx?fullsize=true&id=" & item.Item(1) & "&width=600" + "&height=600"

 

 

 

 

 

 

 

 

 

 

 

 

 

'lowres.Src = imagePath2 + "zoom_icon.png"

 

 

 

 

 

 

ImgBtnFileMgt.ImageUrl = imagePath2 +

 

 

 

 

 

 

"file_management_icon.png"

 

 

 

 

 

 

ImgBtnFileMgt.ToolTip =

 

 

 

 

 

 

"File Management"

 

 

 

 

 

 

ImgBtnFileMgt.CommandArgument = item.Item(1)

 

 

 

ImgBtnFileMgt.Visible =

 

 

 

 

 

 

False

 

 

 

 

 

 

 

 

 

 

 

 

 

'Folder to browsing up a directory - not currently used

 

 

 

 

 

 

 

 

 

 

 

 

If item.Item(8) = "Folder Up"

Then

 

 

 

 

 

 

 

 

 

 

 

 

If Instance.UsePortalDI

Then

 

 

 

 

 

 

 

 

 

 

 

 

 

Else

 

 

 

 

 

 

ImgBtfolderFiles.ImageUrl = imagePath &

 

 

 

 

 

 

"folderUp.png"

 

 

 

 

 

 

 

 

 

 

 

 

 

'put ParentId in cmd args for opening folder above

 

 

 

 

 

 

ImgBtfolderFiles.CommandArgument = _ParentId

 

 

 

ImgBtfolderFiles.CommandName =

 

 

 

 

 

 

"UpFolder"

 

 

 

 

 

 

 

 

 

 

 

 

 

'this passes the controlid and the folderid to a javascript function for selecting the node

 

 

 

 

 

 

NodeValue = _ParentId

 

 

 

 

 

 

'item.Item(1).ToString

 

 

 

 

 

 

ImgBtfolderFiles.OnClientClick =

 

 

 

 

 

"selectNode('" + NodeValue + "', '" + RadTreeClientId +

"');"

 

 

 

 

 

 

 

 

 

 

 

 

End

If

 

 

 

 

 

 

 

 

 

 

 

 

ElseIf item.Item(8) = "Folder" Or item.Item(8) = "DIR " Then

'DIR is for webnative

 

 

 

 

 

 

ImgBtfolderFiles.ImageUrl = DNA.Web.Helper.

 

 

 

 

 

SiteHelper.GetImageUrl("/Modules/DAM/v3/Images/Control/" & "folder_icon.png"

, 112, 112)

 

 

 

 

 

ImgBtfolderFiles.CommandName =

 

 

 

 

 

 

 

 

"OpenFolder"

 

 

 

 

 

 

 

 

 

 

 

 

 

'Hide these buttons

 

 

 

 

 

 

ImgBtnDownload.Visible =

 

 

 

 

 

 

False

 

 

 

 

 

 

ImgBtnInfo.Visible =

 

 

 

 

 

 

False

 

 

 

 

 

 

ImgBtnPreview.Visible =

 

 

 

 

 

 

False

 

 

 

 

 

 

 

 

 

 

 

 

 

'lowres.Visible = False

 

 

 

 

 

 

 

 

 

 

 

 

 

'hires.Visible = False

 

 

 

 

 

 

ImgBtnFileMgt.Visible =

 

 

 

 

 

 

False

 

 

 

 

 

 

lnkbtnPath.Visible =

 

 

 

 

 

 

False

 

 

 

 

 

 

 

 

 

 

 

 

If Instance.UsePortalDI

Then

 

 

 

 

 

 

 

 

 

 

 

 

 

'put Folder Path in cmd args for folder opening

 

 

 

 

 

 

ImgBtfolderFiles.CommandArgument = item.Item(4)

 

 

 

NodeValue = item.Item(4).ToString

 

 

 

 

 

 

 

 

 

 

Else

 

 

 

 

 

 

 

 

 

 

 

 

 

'put FolderId in cmd args for folder opening

 

 

 

 

 

 

ImgBtfolderFiles.CommandArgument = item.Item(1)

 

 

 

NodeValue = item.Item(1).ToString

 

 

 

 

 

 

 

 

 

End

If

 

 

 

 

 

 

 

 

 

 

 

 

 

'this passes the controlid and the folderid to a javascript function for selecting the node

 

 

 

 

 

 

ImgBtfolderFiles.OnClientClick =

 

 

 

 

 

"selectNode('" + NodeValue + "', '" + RadTreeClientId +

"');"

 

 

 

 

 

 

 

 

 

 

 

 

 

Else

 

 

 

 

 

 

 

 

 

 

 

 

If Instance.UsePortalDI

Then

 

 

 

 

 

 

ImgBtfolderFiles.ImageUrl =

 

 

 

 

 

"~/Modules/DAM/V3/Images/image.aspx?id=" + item.Item(1).ToString + "&filename=" + item.Item(3).ToString + "&width=112" + "&height=112" +

"&thumbnail=true"

 

 

 

 

 

 

ImgBtfolderFiles.ToolTip = item.Item(4).ToString

 

 

 

ImgBtfolderFiles.CommandArgument = item.Item(1)

 

 

 

 

 

 

 

 

 

If isSearch

Then

 

 

 

 

 

 

lnkbtnPath.Visible =

 

 

 

 

 

 

True

 

 

 

 

 

 

 

 

 

 

 

 

 

'Displays a link to the folder where the file is (only needed for Search results.)

 

 

 

 

 

 

lnkbtnPath.Text =

 

 

 

 

 

 

"Go to"

 

 

 

 

 

 

lnkbtnPath.ToolTip =

 

 

 

 

 

 

"Go to File"

 

 

 

 

 

 

 

 

 

 

 

 

 

'NodeValue = DNA.Web.Helper.AssetsHelper.RemoveFileNameFromPath(item.Item(4).ToString)

 

 

 

 

 

 

NodeValue = item.Item(4).ToString

 

 

 

lnkbtnPath.CommandArgument = NodeValue

 

 

 

lnkbtnPath.ToolTip = NodeValue

 

 

 

 

 

 

 

 

 

 

'this passes the controlid and the folderid to a javascript function for selecting the node

 

 

 

 

 

 

lnkbtnPath.OnClientClick =

 

 

 

 

 

"selectNode('" + DNA.Web.Helper.AssetsHelper.RemoveFileNameFromPath(NodeValue) + "', '" + RadTreeClientId +

"');"

 

 

 

 

 

 

 

 

 

 

 

 

 

Else

 

 

 

 

 

 

lnkbtnPath.Visible =

 

 

 

 

 

 

False

 

 

 

 

 

 

 

 

 

 

 

 

End

If

 

 

 

 

 

 

 

 

 

 

 

 

 

Else

 

 

 

 

 

 

 

 

 

 

 

 

 

'Now set the image button URL - download link

 

 

 

 

 

 

 

 

 

 

 

 

If item.Item(4).ToString = ""

Then

 

 

 

 

 

 

 

 

 

 

 

 

 

'if not filepath in DB - for ROOT folders this will be

 

 

 

 

 

 

FolderPath = item.Item(3).ToString &

 

 

 

 

 

"\"

& item.Item(7).ToString

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Else

 

 

 

 

 

 

FolderPath = item.Item(4).ToString & item.Item(3).ToString &

 

 

 

 

 

"\"

& item.Item(7).ToString

 

 

 

 

 

 

 

 

 

 

 

 

 

End

If

 

 

 

 

 

 

FullFolderPath = DefaultServerPath & FolderPath

 

 

 

 

 

 

 

 

 

 

'Put in correct backslashes!

 

 

 

 

 

 

FullFolderPath = FullFolderPath.Replace(

 

 

 

 

 

"/", "\"

)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

'for thumbnail images

 

 

 

 

 

 

ImageThumbPath = FullFolderPath

 

 

 

 

 

 

 

 

 

 

'Need double \ not single as this is being passed to javascript

 

 

 

 

 

 

FullFolderPath = FullFolderPath.Replace(

 

 

 

 

 

"\", "\\"

)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

'Function gets the correct image for the file extension

 

 

 

 

 

 

ImgBtfolderFiles.ImageUrl = DNA.Web.Helper.

 

 

 

 

 

AssetsHelper

.ProcessFileExtension(item.Item(9).ToString.ToLower, ImageThumbPath, item.Item(3).ToString.ToLower, imagePath)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

'add attribute button, click event is the it the click event of the button on the html page at run time html button is onclick.

 

 

 

 

 

 

ImgBtfolderFiles.Attributes.Add(

 

 

 

 

 

"onClick", "OnClientFileOpen('" + FullFolderPath + "','" + FileConfirm + "' )"

)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

'If item.Item(9).ToString.ToLower = ".gif" Or item.Item(9).ToString.ToLower = ".jpg" Then

 

 

 

 

 

 

 

 

 

 

 

 

 

' ImgBtfolderFiles.ImageUrl = "../../Tools/Thumbnail.aspx?filename=" & ImageThumbPath & "&height=70&width=50&quality=85"

 

 

 

 

 

 

 

 

 

 

 

 

 

'End If

 

 

 

 

 

 

 

 

 

 

 

 

If item.Item(4).ToString = ""

Then

 

 

 

 

 

 

 

 

 

 

 

 

 

'if not filepath in DB - for ROOT folders this will be

 

 

 

 

 

 

FolderPath = item.Item(3).ToString &

 

 

 

 

 

"\"

& item.Item(7).ToString

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Else

 

 

 

 

 

 

FolderPath = item.Item(4).ToString & item.Item(3).ToString &

 

 

 

 

 

"\"

& item.Item(7).ToString

 

 

 

 

 

 

 

 

 

 

 

 

 

End

If

 

 

 

 

 

 

FullFolderPath = DefaultServerPath & FolderPath

 

 

 

 

 

 

 

 

 

 

'Put in correct backslashes!

 

 

 

 

 

 

FullFolderPath = FullFolderPath.Replace(

 

 

 

 

 

"/", "\"

)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

'Need double \ not single as this is being passed to javascript

 

 

 

 

 

 

FullFolderPath = FullFolderPath.Replace(

 

 

 

 

 

"\", "\\"

)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

'add attribute button, click event is the it the click event of the button on the html page at run time html button is onclick.

 

 

 

 

 

 

ImgBtnDownload.Attributes.Add(

 

 

 

 

 

"onClick", "OnClientFileOpen('" + FullFolderPath + "','" + FileConfirm + "' )"

)

 

 

 

 

 

 

 

 

 

 

 

 

 

End

If

 

 

 

 

 

 

 

 

 

 

 

 

End

If

 

 

 

 

 

 

 

 

 

 

 

 

End

Sub

 

 

 

 

 

 

 

 

 

Konstantin Dikov
Telerik team
 answered on 25 Mar 2015
5 answers
1.3K+ views
Hi 

I have a requirement like I want to disable the autocomplete feature for a particular textbox. Also is it possible to restrict the cut copy and paste operation?

Thanks,
Tia.
Dhamodharan
Top achievements
Rank 1
 answered on 25 Mar 2015
1 answer
102 views
 Hello,
I want to check how we can show the custom error messages inside the grid. so in this case, if returned rows are more than 100, we need to show a message for user to narrow down the search.

I enabled EnabledNoRecordsTemplate for the grid if no records are returned but not sure how we can another message inside the grid based on some condition.

Your help will be highly appreciated.

Thanks!
Konstantin Dikov
Telerik team
 answered on 25 Mar 2015
3 answers
263 views
Sorry for the long description but it's the only way I can explain this.

I'm currently working on a RadGrid with 5 columns. On page load if there are existing rows for an invoice, they are loaded into the grid, if there are none then it creates a new one ready for batch editing. When the user fills in the Code cell and tabs to the next which is Description, I make a webmethod call to the database to get the corresponding description and want to will that into the next column. This is all working, until I add multiple rows. For some reason the indexes retrieve the rows in inverse order. For example if I create the first row, fill in Code, hit tab, Description is populated from the database. If I create another row, fill in Code, hit tab, Description in the first row updated, not two. If I change the Code in row one again, Description in row two is updated. This holds up for any number of added rows. If there are any existing rows from the database, this does not happen. I can update Code and Description is updated correctly. When I try to add new rows to a table with existing loaded from the database, the crazy index logic starts again.

Here is the javascript I am using to make the cell changes. This is called on RadGrid2_OnBatchEditCellValueChanged:
function getDescription(sender, args) {
                var grid = $find('<%= RadGrid2.ClientID %>');
                var masterTable = grid.get_masterTableView();
                var rows = masterTable.get_dataItems();
                var rowArgs = args.get_row();
                var rowIndex = rowArgs.sectionRowIndex;
                var row = rows[rowIndex];
                var newValue = args.get_editorValue();
 
                var lineDescCell = row.get_cell("Description");
                var lineDesc = sender.get_batchEditingManager().getCellValue(lineDescCell);
 
                $.ajax({
                    type: "POST",
                    url: "Invoice.aspx/LookupCode",
                    data: JSON.stringify({ code: newValue }),
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (msg) {
                        lineDesc = (!msg || !msg.d) ? "Invalid Code" : msg.d;
                        grid.get_batchEditingManager().changeCellValue(lineDescCell, lineDesc);
                    },
                    error: function (response) {
                        alert('LookupCode failed: ' + response);
                    }
                });
            }

If I can provide any extra explanation or code please let me know. Any help on this issue would be much appreciated.

Nick
Nick
Top achievements
Rank 1
 answered on 25 Mar 2015
1 answer
126 views
we are using the latest version of Rad Editor.  we have some third party javascript widgets which we have installed within the html.  we have the scripts filter turned off. 

the problem we are having is that when we go to edit the html the java applets are running and displaying the appropriate data. when we go to save the form, the html changes are saved but so is the applet data instead of the java script which existed prior to page loading.

Is there a way to prevent this from occurring?  the problem is that the vendors require the javascript to be embeded within the html in the spot where the data is to be displayed..

Thanks for your help and ideas.
Ianko
Telerik team
 answered on 24 Mar 2015
5 answers
611 views
I'm not a .Net programmer by trade but, I need to make some customizations to editor. I was wondering if someone could tell me if WebResource.axd creates a local cache of the javascript files that are sent to the client when requested, and how to force the cache to be re-generated from the source copies? My changes aren't showing up on the client side even after clearing cache, disabling browser cache and trying on 3 different browsers.
Ianko
Telerik team
 answered on 24 Mar 2015
4 answers
106 views
I have an issue when attempting to print from the RadEditor in IE11.  
The print button opens the standard print dialog box - which prints the entire web page - not the contents of the radeditor in either div or iframe contentmode.
In Chrome it works fine - it opens a preview page which prints the contents as expected.
I have attempted to use togglefullscreen to send the radeditor into full screen mode - but it only expands as far as the bounds of the table cell it is contained within, in chrome in works fine and expands to full page as expected - but can't use this option it seems in IE.

is there any trick to allowing RadEditor to open the print preview dialog in ie, and to preview just the contents of the radeditor, and also ensure that the togglefullscreen mode expands to cover the entire screen??

thanks.  M.
Ianko
Telerik team
 answered on 24 Mar 2015
3 answers
137 views
Hello,

Are there any known conflicts between Telerik Ajax Controls and AjaxToolKit 15.1? 
There are many things using Telerik.  Just wanted to check before I install the update.

Thanks
JS
Pavlina
Telerik team
 answered on 24 Mar 2015
1 answer
176 views
Hi,

I have a RadGrid which is initialzed to a SqlDataSource and itz working fine. Now, I want to make one of the data field from the sql source as a HyperText.

I am doing following in Code Behind.

GridHyperLinkColumn hyperlinkcolumn = GridHyperLinkColumn();
hyperlinkcolumn.DataField = "<MyColumnName_FromSql>"
hyperlinkcolumn.DataNavigateUrlFields = "<MyColumnName_FromSql>"
hyperlinkcolumn.DataNavigateUrlFormatString = "URL String"

MyGrid.Columns.Add(hyperlinkcolumn);

Whne I do this, I am seeing two columns. One original column from the sql data source and one hyperlink column i added.

I tried additing to MasterTableView as well. But still two columns are coming.

I expect only hypertext column to present and original column to not present.

How to achieve this??

THanks
Satish

Eyup
Telerik team
 answered on 24 Mar 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?