<html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>UploadManager voor productafbeeldingen</title> <link href="CSI/css/custom/admin.css" rel="stylesheet" type="text/css" /> <link href="CSI/CSS/telerik/Slider.UIN.css" rel="stylesheet" type="text/css" /> <link href="CSI/CSS/telerik/ComboBox.UIN.css" rel="stylesheet" type="text/css" /> <link href="CSI/CSS/telerik/Calendar.UIN.css" rel="stylesheet" type="text/css" /> <link href="CSI/CSS/telerik/Input.UIN.css" rel="stylesheet" type="text/css" /> <link href="CSI/CSS/telerik/TreeView.UIN.css" rel="stylesheet" type="text/css" /> <link href="CSI/CSS/telerik/Upload.UIN.css" rel="stylesheet" type="text/css" /> <link href="CSI/CSS/telerik/FileExplorer.UIN.css" rel="stylesheet" type="text/css" /> <script src="CSI/JS/3rdparty/flash_detect.js" type="text/javascript"></script> <script src="CSI/JS/jQuery/jquery-1.6.2.min.js" type="text/javascript"></script> <script src="CSI/JS/jQuery/jquery-1.2.6.min.js" type="text/javascript"></script> <script src="CSI/JS/telerik/IntegrationScripts.js" type="text/javascript"></script> <telerik:RadCodeBlock ID="codeBlock1" runat="server"> <script type="text/javascript"> //<![CDATA[ function OnClientDirectoryChange(sender, args) { alert("Tree dir change: " + args.get_path()); } function OnClientItemClick(sender, args) { alert("Item click: " + args.get_path()); } //]]> </script> </telerik:RadCodeBlock> </head>
<body> <form runat="server" id="mainForm" method="post"> <telerik:RadScriptManager ID="ScriptManager1" runat="server" /> <telerik:RadProgressManager ID="Radprogressmanager1" runat="server" /> <div class="productimagemanager"> <div class="qualitycenter"> <div class="fileexplorer"> <table cellspacing="4"> <tr> <td rowspan="2" style="vertical-align: top;"> <telerik:RadFileExplorer runat="server" ID="RadFileExplorer1" Width="700px" Height="500px" Skin="UIN" EnableOpenFile="true" OnClientLoad="OnFileExplorerLoad" OnClientFolderChange="OnClientDirectoryChange"> <Configuration ViewPaths="~/media/QualityCenter/forapproval/retailer65" DeletePaths="~/media/QualityCenter/forapproval/retailer65" UploadPaths="~/media/QualityCenter/forapproval/retailer65" /> </telerik:RadFileExplorer> </td> </tr> </table> </div> <asp:Panel ID="ListViewHolder" runat="server"> <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel" runat="server"> </telerik:RadAjaxLoadingPanel> <telerik:RadXmlHttpPanel ID="RadXmlHttpPanel1" runat="server" OnServiceRequest="RadXmlHttpPanel1_ServiceRequest" RenderMode="Block" EnableClientScriptEvaluation="true" LoadingPanelID="RadAjaxLoadingPanel" OnClientResponseEnded="OnClientResponseEnded"> <telerik:RadContextMenu ID="RadListViewContextMenu" runat="server" OnClientItemClicked="RadListViewMenuItemClicked"> </telerik:RadContextMenu> <telerik:RadListView ID="RadListView1" runat="server" ItemPlaceholderID="ItemPlaceHolder1" AllowPaging="true" AllowCustomPaging="true" PageSize="6" OnItemDataBound="RadListView1_ItemDataBound" OnItemCommand="RadListView1_ItemCommand"> <LayoutTemplate> <div class="imagelibrary"> <div class="actiebuttons"> <asp:ImageButton ID="btnSaveNewImageNames" runat="server" ImageUrl="~/App_Themes/UIN/Layout/buttons/opslaanensluitenbutton.png" Width="194px" Height="30px" ToolTip="Opslaan artikel en artikelwizard afsluiten" CommandName="updatefilenames" Visible="false" /> </div> <asp:PlaceHolder ID="ItemPlaceHolder1" runat="server"></asp:PlaceHolder> </div> </LayoutTemplate> <ItemTemplate> <asp:Panel ID="itemTemplateHolder" runat="server" CssClass="lvItemTemplate" ondblclick="openImageForPreview(this);" onclick="imageSelected(this);"> <div class="imageitem"> <div class="imagefile"> <asp:Image ID="imgImageFile" runat="server" ImageUrl='<%# DataBinder.Eval(Container.DataItem, "Path") %>' AlternateText="Image" CssClass="imagefile" /> <asp:ImageButton ID="imgDeleteFile" runat="server" ImageUrl="~/App_Themes//UIN//Layout//buttonDeleteImage.png" CssClass="deleteimage" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "Path") %>' OnClick="imgDeleteFile_Click" OnClientClick="return confirm('Weet u zeker dat u deze afbeelding wilt verwijderen?');" /> <input type="hidden" value="<%# GetFileItemProperties(Container.DataItem) %>" /> </div> <div class="imageoldname"> <asp:Label ID="lblImageOldNameLabel" runat="server" Text="Huidige bestandsnaam" CssClass="labelheader"></asp:Label> <asp:Label ID="lblImageOldName" runat="server" CssClass="imagenamelabel" Text='<%# DataBinder.Eval(Container.DataItem, "Name") %>'></asp:Label></div> <div class="imagenewname"> <asp:Label ID="lblImageNewName" runat="server" Text="Nieuwe naam" CssClass="labelheader"></asp:Label> <asp:TextBox ID="txtImageNewName" runat="server"> </asp:TextBox></div> </div> </asp:Panel> </ItemTemplate> </telerik:RadListView>
</telerik:RadXmlHttpPanel> </asp:Panel> </div> </div>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> <script type="text/javascript"> function loadListViewContent(pathToFolder, sliderIndex) { var pageIndexChangeArg = pathToFolder + "$|$" + sliderIndex; var oXmlPanel = $find("<%= RadXmlHttpPanel1.ClientID %>"); selectedListViewItems = []; // Clear selection oXmlPanel.set_value(pageIndexChangeArg); } function getRadFileExplorer1() {// returns RadFileExplorer1 client-side object var oExplorer = $find("<%= RadFileExplorer1.ClientID %>"); return oExplorer; } </script> </telerik:RadCodeBlock> </form></body></html>protected void Page_Load(object sender, System.EventArgs e) { RadFileExplorer1.VisibleControls = Telerik.Web.UI.FileExplorer.FileExplorerControls.ContextMenus | Telerik.Web.UI.FileExplorer.FileExplorerControls.TreeView| Telerik.Web.UI.FileExplorer.FileExplorerControls.AddressBox; //set properties according to configuration panel RadFileExplorer1.Configuration.SearchPatterns = new string[] { "*.jpg", "*.jpeg" }; RadFileExplorer1.EnableOpenFile = false; RadFileExplorer1.DisplayUpFolderItem = true; RadFileExplorer1.AllowPaging = false; RadFileExplorer1.EnableCreateNewFolder = false; RadFileExplorer1.FindControl("paneTree").Controls.Add(ListViewHolder); if (!Page.IsPostBack) { BindCollections(); txtArchiveName.Text = DateTime.Today.ToShortDateString(); if (!string.IsNullOrEmpty(RadFileExplorer1.InitialPath)) { bool isDirectory = VirtualPathUtility.GetExtension(RadFileExplorer1.InitialPath) == string.Empty; if (isDirectory) {// The InitialPath points to a file // Get the directory: string parentDirectory = VirtualPathUtility.GetDirectory(RadFileExplorer1.InitialPath); LoadListViewData(0, parentDirectory); } else {// The InitialPath contains a directory path string parentDirectory = RadFileExplorer1.InitialPath; LoadListViewData(0, parentDirectory); } } else {// The InitialPath property is not set ==> load the first folder in the ViewPaths property string targetFolder = RadFileExplorer1.Configuration.ViewPaths[0] + "/" + cboCollection.Items[0].Text.Replace(" ", "_"); // +"/" + txtArchiveName.Text; string parentDirectory = targetFolder; // RadFileExplorer1.Configuration.ViewPaths[0]; LoadListViewData(0, parentDirectory); } } else { Control postbackControl = GetPostBackControl(this);// get the control that is coused the post back ; if (postbackControl != null && postbackControl.ID == "buttonSubmit") { RadFileExplorer1.TreeView.Nodes.Clear(); TargetFolder = "~/" + RETAILER_IMAGEPATH + FILIAAL_ID + "/" + cboCollection.Items[0].Text + "/" + txtArchiveName.Text; RadFileExplorer1.InitialPath = Page.ResolveUrl(TargetFolder); } } //RemoveBackForwardRefreshButtons(); }protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); if (IsPostBack) {// This code ensures that the RadListView's content will be refreshed when a new file is uploaded string parentDirectory = RadFileExplorer1.CurrentFolder; LoadListViewData(0, parentDirectory); } }protected void imgDeleteFile_Click(object sender, ImageClickEventArgs e) { File.Delete(Server.MapPath(((ImageButton)sender).CommandArgument)); } protected void RadListView1_ItemDataBound(object sender, RadListViewItemEventArgs e) {// This event is used in order to associate the 'RadListViewContextMenu' with every itemTemplateHolder panes in the RadListView Telerik.Web.UI.RadListViewDataItem lvitem = (Telerik.Web.UI.RadListViewDataItem)e.Item; ContextMenuElementTarget elementTarget = new ContextMenuElementTarget(); Control paneControl = e.Item.FindControl("itemTemplateHolder"); RadBinaryImage oImage = e.Item.FindControl("imgImageFile") as RadBinaryImage; ImageButton oDeleteImage = e.Item.FindControl("imgDeleteFile") as ImageButton; elementTarget.ElementID = paneControl.ClientID; RadListViewContextMenu.Targets.Add(elementTarget); } protected void RadListView1_ItemCommand(object sender, RadListViewCommandEventArgs e) { if (e.CommandName == "updatefilenames") { foreach (RadListViewDataItem item in RadListView1.Items) { TextBox oNewImageName = item.FindControl("txtImageNewName") as TextBox; Label oOldImageName = item.FindControl("lblImageOldName") as Label; Image oImage = item.FindControl("imgImageFile") as Image; string path = RadFileExplorer1.CurrentFolder; if (oOldImageName != null && oNewImageName != null) { if (oNewImageName.Text != string.Empty) { string updatePath = oImage.ImageUrl.Replace(oOldImageName.Text, oNewImageName.Text + ".jpg"); File.Move(Server.MapPath(oImage.ImageUrl), Server.MapPath(updatePath)); } } } LoadListViewData(0, RadFileExplorer1.CurrentFolder); } } protected void RadXmlHttpPanel1_ServiceRequest(object sender, RadXmlHttpPanelEventArgs e) {// The value of e.Value looks like this: '/ListViewIntegration/FileExplorer/ExplorerSource/Images/Customers$|$0' string[] arguments = e.Value.Split(new string[] { "$|$" }, StringSplitOptions.RemoveEmptyEntries); string pathToFolder = arguments[0]; string sliderValue = arguments[1]; int sliderIndexAsInt = int.Parse(sliderValue); LoadListViewData(sliderIndexAsInt, pathToFolder); } private void LoadListViewData(int sliderIndex, string pathToFolderForLoad) { List<FileItem> allFilesInFolder = GetFilesSorted(pathToFolderForLoad); if (allFilesInFolder.Count.Equals(0)) {// No files in directory //RadSlider1.Enabled = false;// Disable slider (or hide it (RadSlider1.Visible = false)) RadListView1.DataSource = null; RadListView1.DataBind();// Clear content ((ImageButton)RadListView1.FindControl("btnSaveNewImageNames")).Visible = false; } else { //RadSlider1.Enabled = true;// Enable RadeSlider // Starting index int fromIndex = sliderIndex * RadListView1.PageSize; // Calculate the count of the images int count = (fromIndex + RadListView1.PageSize) < allFilesInFolder.Count ? RadListView1.PageSize : allFilesInFolder.Count - fromIndex; // Get maximum 4 files at a time List<FileItem> listViewSource = allFilesInFolder.GetRange(fromIndex, count); RadListView1.DataSource = listViewSource; RadListView1.DataBind(); ((ImageButton)RadListView1.FindControl("btnSaveNewImageNames")).Visible = true; long outLong = new long();// USed in order to be compliant with the VB.NET version // Refresh slire's values //RadSlider1.MaximumValue = (allFilesInFolder.Count % RadListView1.PageSize).Equals(0) ? Math.DivRem(allFilesInFolder.Count, RadListView1.PageSize, out outLong) - 1 : Math.DivRem(allFilesInFolder.Count, RadListView1.PageSize, out outLong); //RadSlider1.Value = sliderIndex; // Checks permissions and associates a context menu with all images in the ListView CreateListContextMenu(pathToFolderForLoad); } } private void CreateListContextMenu(string pathToOpenedFolder) { RadTreeViewContextMenu treeContextMenu = RadFileExplorer1.TreeView.ContextMenus[0]; RadListViewContextMenu.Items.Clear(); foreach (RadMenuItem treeMenuItem in treeContextMenu.Items) { RadMenuItem clonedTreeMenuItem = treeMenuItem.Clone(); switch (clonedTreeMenuItem.Value) { case "Delete": { bool enableCommand = ContentProvider.CheckDeletePermissions(pathToOpenedFolder); if (enableCommand) {// The path has Delete permisson ==> Delete is allowed RadListViewContextMenu.Items.Add(clonedTreeMenuItem); } } break; case "Upload": { bool enableCommand = ContentProvider.CheckWritePermissions(pathToOpenedFolder); if (enableCommand) {// The path has Write permisson ==> upload is allowed RadListViewContextMenu.Items.Add(clonedTreeMenuItem); } } break; } } if (RadFileExplorer1.EnableOpenFile) { RadMenuItem openFileItem = new RadMenuItem(); openFileItem.Value = "Open"; openFileItem.Text = "Open"; openFileItem.PostBack = false; openFileItem.EnableViewState = false; openFileItem.SelectedCssClass = "rfeNoClass"; RadListViewContextMenu.Items.Add(openFileItem); } RadListViewContextMenu.Skin = RadFileExplorer1.Skin; } /// <summary> /// Returns an instance of FileBrowserContentProvider asociated with RadFileExplorer control. If a cusom provider is used, then this propperty should return /// an instance of that cusom provider. /// </summary> private FileBrowserContentProvider ContentProvider { get { if (object.Equals(this._contentProvider, null)) { this._contentProvider = new FileSystemContentProvider(this.Context, RadFileExplorer1.Configuration.SearchPatterns, RadFileExplorer1.Configuration.ViewPaths, RadFileExplorer1.Configuration.UploadPaths, RadFileExplorer1.Configuration.DeletePaths, string.Empty,
} return this._contentProvider; } }<telerik:RadScriptBlock> <script type="text/javascript"> var mySelectedGrid; var mySelectedGrid_MasterTableView; function GetGridObject(sender, eventArgs) { var _mySelectedGrid = sender; mySelectedGrid = $find(_mySelectedGrid.ClientID); mySelectedGrid_MasterTableView = mySelectedGrid.get_masterTableView(); } </script> </telerik:RadScriptBlock><telerik:RadEditor runat="server" ID="RadEditor1" Height="350px" DialogsCssFile="./RTL/RadEditor_Dialogs_RTL.css" ContentAreaCssFile="./RTL/EditorContentArea_RTL.css"> <Modules> <telerik:EditorModule Visible="false" /> </Modules> </telerik:RadEditor> 
<EditFormSettings EditFormType="WebUserControl" UserControlName="StudentDependent.ascx" InsertCaption="Add new dependent">
<PopUpSettings Modal="true" ScrollBars="Auto" />
</EditFormSettings>
HI ,
I have an issue with Teleric Grid Column Hiding.
The Grid Looks perfect when it populated with data.
Once we are trying to hide few columns ( on Right click column Head + uncheck column names to hide) - The grid is not fitting to previous width ( or we can say 100% if assigned width ) - Its jst leaning towards left side with around 50% of the actual width.
Can you please help us solving this issue.
Thanks in Advance.
Dilip.
Hi,
I have a telerik page pageX.aspx working fine on
www.x.co.uk/pageX.aspx
Now, for certain reasons I would like to reuse this page but with the url on a subdomain as -
sub.x.co.uk/pageX.aspx
I am using Host Headers and URL rewriting to make the call to PageX.aspx from both urls (but using the same code base).
I use a base href of
<base href="http://www.x.co.uk/" />
as part of my URL Rewriting
Now, The www URL works fine ./
But I get (or equivalent)
Message: Access is denied.
Line: 6
Char: 63059
Code: 0
URI: http://www.x.co.uk/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-GB%3afab31106-1bd6-4491-9a14-59e0fc4a7081%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%3aen-GB%3abd09f19b-b595-4ea4-8ab8-449a745bc83c%3a16e4e7cd%3af7645509%3a22a6274a%3a24ee1bba%3af46195d3%3a874f8ea2%3a19620875%3a39040b5c%3af85f9819%3a490a9d4e%3abd8f85e4
when loading up the sub.x.co.uk/pageX.aspx
Could you please advise me on why this is happening (obviously something to do with x-domain access from sub to www) and what I can do to rectify this asap?
Many Thanks
Matt