RadListView & RadDataPager changing page size error

4 posts, 0 answers
  1. Steven
    Steven avatar
    4 posts
    Member since:
    Sep 2008

    Posted 11 May 2011 Link to this post

    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

     

     

     

     

     

     

     

     

     

  2. Veli
    Admin
    Veli avatar
    2002 posts

    Posted 16 May 2011 Link to this post

    Hello Steven,

    We couldn't identify any cause for the exception you are getting from the code you posted. Can you, please, send us the stack trace of the exception you are getting. If this issue persists, consider opening a regular support ticket where you can send us some sample project or a test page we can debug locally. This will help us better identify the cause of this issue.

    Greetings,
    Veli
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. William Wittsche
    William Wittsche avatar
    8 posts
    Member since:
    Aug 2009

    Posted 21 Mar 2015 in reply to Veli Link to this post

    I understand this is an old post, but what was the outcome of this problem? I am having a very similar problem. Thank You.
  5. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1798 posts

    Posted 25 Mar 2015 Link to this post

    Hi William,

    There was no regular support ticket opened on this matter, so we do not have any additional information on this particular issue.

    However, if you are receiving the same error, can you please open a regular support ticket and try to isolate the issue in a sample, runnable project, so we can test it locally and see what could cause the problem with your implementation.

    If you can simplify the markup and the code-behind you could also post the code snippets here.


    Regards,
    Konstantin Dikov
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top