Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
76 views
Hi Admin, I want to export a  excel report file. It include infomation customer( radgrid on usercontrol), oder(radgrid on usercontrol), order detail (Radgird on mainpage). I dont know how to combie data on many control-> a report.
Please show me how to solve it!
Thanks
David Tran

<div id="uxPOContainer" runat="server" class="POContainer">
        <asp:HiddenField runat="server" ID="hdfOrderId" />
        <uc:CustomerInfo ID="uxCustomerInfo" runat="server"></uc:CustomerInfo>
        <uc:OrderInfo ID="uxOrderInfo" runat="server"/>        
        <div class="myborder" ></div>
        <asp:Button ID="uxEditOrd" runat="server" Text ="Edit Order" OnClick="uxEditOrd_Click" CssClass="ButtonType1" Visible="false"  />
        <asp:PlaceHolder ID="phDetail" runat="server">
            <ext:RadListView runat="server" ID="rlvOrderDetail" ItemPlaceholderID="plhDetail" OnItemDataBound="rlvOrderDetail_ItemDataBound"
                OnNeedDataSource="rlvOrderDetail_NeedDataSource" OnItemCreated="rlvOrderDetail_ItemCreated" BorderWidth="1" >
                <LayoutTemplate>
                    <table class="FixTableOD TablePaddingTD TableWithInputFocus" border="1">
                        <colgroup>
                            <col class="w5" />
                            <col class="w25" />
                            <col class="w15" />
                            <col class="w10" />
                            <col class="w10" />
                            <col class="w15" />
                            <col class="w10" />
                            <col class="w10" />
                        </colgroup>

                        <thead class="TableHeader">
                            <tr>
                                <th></th>
                                <th class="FormatString"><%# Resources.LocalizedStrings.FieldName_ProductName %></th>
                                <th class="FormatNumber"><%# Resources.LocalizedStrings.FieldName_Quantity %></th>
                                <th class="FormatCode"><%# Resources.LocalizedStrings.Products_Grid_ProductUnit %></th>
                                <th class="FormatNumber"><%# Resources.LocalizedStrings.FieldName_UnitPrice %></th>
                                <th class="FormatNumber"><%# Resources.LocalizedStrings.FieldName_Amount %></th>
                                <th class="FormatDate"><%# Resources.LocalizedStrings.FieldName_ExpectDeliveryDate %></th>
                                <th class="FormatNumber"><%# Resources.LocalizedStrings.FieldName_CBM %></th>
                            </tr>
                        </thead>
                        <tbody>
                            <asp:PlaceHolder ID="plhDetail" runat="server"></asp:PlaceHolder>

                        </tbody>
                        <tfoot class="OrderDetailFooter inlineTableBg">
                            <tr>
                                <td colspan="2" >
                                    <asp:Label ID="Label1" runat="server" Text="<%$ Resources: LocalizedStrings,FieldName_Total %>"> </asp:Label>

                                </td>
                                <td class="FormatNumber" >
                                    <asp:Literal runat="server" ID="ltrTotalQuantity"></asp:Literal>
                                      <p class="totalQty">
                                    <asp:Literal runat="server" ID="ltrTotalQtyByCarton">
                                    </asp:Literal>
                                    <br />
                                    <asp:Literal runat="server" ID="ltrTotalQtyByPcs">
                                    </asp:Literal>
                                </p>
                                </td>
                                <td></td>
                                <td></td>
                                <td class="FormatNumber">
                                    <asp:Literal runat="server" ID="ltrTotalAmount"></asp:Literal>

                                </td>
                                <td></td>
                                <td class="FormatNumber">
                                    <asp:Literal runat="server" ID="ltrTotalCBM"></asp:Literal>
                                </td>
                            </tr>
                        </tfoot>
                    </table>
                </LayoutTemplate>

                <ItemTemplate>
                    <div id="uxCalc">
                        <tr>
                            <td class="FormatNumber">
                                <%# Container.DataItemIndex + 1 %>
                            </td>
                            <td title='<%# Eval("ProductId") %>'>
                                <asp:HiddenField ID="ItemIndex" Value="<%# Container.DataItemIndex %>" runat="server" />
                                <%# Eval("ProductName") %>
                            </td>

                            <td class="FormatNumber">
                                <asp:Label  ID="uxQuantity" runat="server"><%# (int.Parse( Eval("Quantity").ToString())).ToString("#,##0") %></asp:Label>
                              

                            </td>
                            <td class="FormatCode">
                                <asp:Label ID="uxUOM" runat="server" Visible="false"  ><%#  Eval("UOM").ToString() %> </asp:Label>
                                <asp:Label ID="uxUOMName" runat="server" ></asp:Label> 
                            </td>
                            <td class="FormatNumber">
                                 <asp:Label ID="uxUnitPrice" runat="server"><%# (double.Parse( Eval("UnitPrice").ToString())).ToString("#,##0.00") %></asp:Label>
                            </td>
                            <td class="FormatNumber">
                                 <asp:Label ID="uxAmount" runat="server"><%# (double.Parse( Eval("Amount").ToString())).ToString("#,##0.00")  %></asp:Label>
                            </td>

                            <td class="FormatDate">
                                <asp:Label ID="uxExpectDeliveryDate" runat="server"><%# Eval("ExpectDeliveryDate").ToString() %></asp:Label>
                            </td>
                            <td class="FormatNumber">
                                 <asp:Label ID="uxCBM" runat="server"><%# double.Parse( Eval("CBM").ToString()) %></asp:Label>
                                
                            </td>
                        </tr>
                    </div>
                </ItemTemplate>


            </ext:RadListView>
        </asp:PlaceHolder>
    </div>
Kostadin
Telerik team
 answered on 25 Mar 2015
3 answers
154 views
Hello, 
I tried to Disable the Radtooltip,
<telerik:RadToolTip ID="RadToolTip1" runat="server" TargetControlID ="myTarget"  Position ="TopCenter"  AutoCloseDelay ="0"  Enabled ="false">


but the Tooltip is still active... 

I want to disable / enable the tooltip with Javascript, 
but set_visible(true / false) don't work.

I Use the RadControls Q1 2009 

any Idea ?           
Marin Bratanov
Telerik team
 answered on 25 Mar 2015
3 answers
249 views
Hello,

We are working on a very important project for our company.
Our project uses Telerik’s RadGrid control.
We are showing the DetailTable, when the user expands a The Master Table View.

We are 100% SURE that this issue was not present before an upgrade of Telerik’s Controls!
It doesn't work now and we don’t know why.

This is extremely important for us the we solve this issue as soon as possible, as we need to demonstrate the project to our clients soon!

The user can request different information through various reports.
Each time the user requests a report, new information is shown in the RadGrid.
However, the TableDetailView always retains the same columns, as the first request of details!? 

Please see this video: http://youtu.be/6dFA2mqep_U

How can I fix that?  

Thanks,
Daniel.
.NET Programmer at
ISR Corp.
Daniel
Top achievements
Rank 1
 answered on 25 Mar 2015
1 answer
98 views
I have a telrik Grid with a FormTemplate, Inside of that I have a Multiline text box and two DropDownList controls. Because the Multiline text box takes up so much space the other controls appear to be aligning to the bottom and I want them to align to the top within the template. I haven't been able to figure out how or where to apply something like the ItemStyle-VerticalAlign="Top" and actually get it to work. I would appreciate any thoughts anyone might have.

Below is my current code:


<EditFormSettings EditFormType="Template">
    <FormTemplate>                           
        <
div class="editGridSubGoal">>                     
            <
asp:Label ID="lblSubGoalText" runat="server" Text="Sub-Goal:"  AssociatedControlID="tbSubGoalText"  Visible="false"  /> 
            <asp:TextBox ID="tbSubGoalText" runat="Server" TextAlign="Right" TextMode="MultiLine" Rows="5" Columns="55"
                 Text='<%# Eval("SubgoalText") %>' MaxLength="255" style=" overflow:auto;"  
                 onkeydown="if (this.value.length > 255) this.value = this.value.substring(0, 255);"
                 onkeyup="if (this.value.length > 255) this.value = this.value.substring(0, 255);"/>
            <asp:RequiredFieldValidator ID="tbSubGoalText_RequiredFieldValidator" runat="server" ErrorMessage="* Required" CssClass="validator" ControlToValidate="tbSubGoalText" Display="Dynamic" />
            <asp:Label ID="lblEditSubGoalStatus" runat="server" Text="Status:" AssociatedControlID="ddlSubGoalStatus" Visible="false" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:DropDownList ID="ddlSubGoalStatus" runat="server" SelectedValue='<%# Bind("StatusTypeCode") %>'>                              <asp:ListItem Value="INPROGRESS" Text="In Progress" />
            <asp:ListItem Value="MET" Text="Met" />
            <asp:ListItem Value="UNMET" Text="Un-Met" />
            </asp:DropDownList>
            <asp:LinkButton ID="btnCancelSubGoal" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel"></asp:LinkButton>
            <asp:LinkButton ID="btnSaveSubGoal" runat="server"  CssClass="silverLinkButton"  CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' ><span>Save</span></asp:LinkButton>
        </div>
   </FormTemplate>


Viktor Tachev
Telerik team
 answered on 25 Mar 2015
1 answer
114 views
Hello,

I'm new to this forum, spending my last few hours searching for information/help, but with no results I decided to join and ask. Hope it's correct place, if not then please move it to more appropriate section.

I have moderate knowledge of C# and Java but was tasked with creating simple(at first glance) Chrome Extension. I wasn't familiar at all with all of quirks and small things that JS comes with, but was doing ok until I got to a point, where I have no idea what to do.

I'm using latest Chrome(41.0.2272.89.m as I'm writing this), with Windows 7 Enterprise.

The problem is that when user fills out one NumericBox and leaves focus(with TAB or clicking something else) onblur() is invoked and some other fields are updated with entered data. But I need to fill these boxes with extension that parses user provided string. And here is root of my problem.

In Chrome developer console, elements pane, when I locate element in question and look at event listeners I can see handler at blur event. Same goes for console:
var element=InputFormOnPageSampleNameForExamplePurposesOnly
element._events.blur[0].handler()  //<-this actually executes and updates what I need!

But, when I look at:
element.blur
//returns
function blur() { [native code] }
 
element.blur()
//returns
undefined

In my extension, to update them all I put element IDs in an array, then foreach it with function that I would like to call blur() handler on each of these elements, but I can't manage to do this and after around 4 hours of research I'm feeling stuck.When debugging with breakpoint inside loop I can see that current processed element has all regular properties except these written in ALL_CAPS and _events 
Is it even possible to fire this event from Chrome extension? Everything else so far works ok, but without this continuing this extension will be pointless as user will need to click each field at least once in order to update it.

And I have tried also trying to get those field select()-ed or click()-ed and even simulate keypresses, but nothing helped.
Abdiasz
Top achievements
Rank 1
 answered on 25 Mar 2015
3 answers
218 views
Hi,
I am using 2 RadListbox for item transfer with help of OnTransferring event,it is working fine in my local system and no build errors in VS2010,even working fine after publish in Local IIS server in my system,but after publish in to public IIS server it is showing below error in IE Browser:

 'Telerik' is undefined
'Telerik.Web.UI.RadListBox' is null


Please support.

Thanks and Regards,
Santhosh Naik

Aneliya Petkova
Telerik team
 answered on 25 Mar 2015
1 answer
171 views
I can insert radio button using the form button on the RadEditor tool bar. How do you put then into a group. Radio buttons are not very useful if you can select them all and they are not grouped....
Danail Vasilev
Telerik team
 answered on 25 Mar 2015
4 answers
191 views
I have a AJAX DropDownTree that has checkboxes on it.

When I use a webservice to load child nodes in the RadDropDownTree I need to be able to set Checked=true on some of the child DropDownDataNodes that I create.

When creating the nodes in the webservice code is their any way I can access the Checked property on the DropDownDataNodes as the Checked property doesn't seem to be available?


Or if I could hook into an event that fires when the webservice call ends...could I set the new child items Checked property then?

Dominic
Top achievements
Rank 1
 answered on 25 Mar 2015
1 answer
339 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
203 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?