Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
222 views
Hello,

I have recently upgraded from Q3 2011 to Q3 2012 and now my Spin Buttons on the numeric text box appears on the bottom of the control rather than to the side (attached image). Can anyone give me a suggestion on what is causing this.

Thanks
Vasil
Telerik team
 answered on 26 Nov 2012
1 answer
85 views
hey guys,


   I want to export my radgrid data in word document but without using sqldatasource how can i do that?
Shinu
Top achievements
Rank 2
 answered on 26 Nov 2012
1 answer
99 views
Can the default sort filter value be passed by session variable or a temporary value from another page and be set on load?
Princy
Top achievements
Rank 2
 answered on 26 Nov 2012
2 answers
139 views
hi,
I need to provide a minimum value for zoomout button.
how can i set a value for zoomout button in telerik image editor.
Chintha
Top achievements
Rank 1
 answered on 26 Nov 2012
3 answers
74 views

I have a bar chart with multiple series.

   chartResults.DataManager.ValuesYColumns = "fValue"
   chartResults.DataManager.ValuesXColumn = "iDate"
   chartResults.DataGroupColumn = "sType"
   chartResults.PlotArea.XAxis.Appearance.ValueFormat = Styles.ChartValueFormat.ShortDate
   chartResults.DataSource = dt
   chartResults.DataBind()

   chartResults.PlotArea.XAxis.AutoScale = True  
   chartResults.PlotArea.XAxis.IsZeroBased = False
   chartResults.PlotArea.YAxis.IsZeroBased = True
   chartResults.PlotArea.XAxis.Appearance.Visible = Styles.ChartAxisVisibility.True

When one series exists, the rightmost point lies to the right (correctly) of XLabel 10/23/2012. When a second series is added, the rightmost point moves to the left of 10/23/2012. This is incorrect, and does not reflect the accuracy of the first series. 

Can someone offer any advice, or workaround to get the points to stay on their correct x-axis point? 
Any help or advice is greatly appreciated! TIA!

Waseem
Top achievements
Rank 1
 answered on 24 Nov 2012
14 answers
1.0K+ views
We have placed a RadUpload control in a DotNetNuke module and selected the file. We also have an asp:button on the control set to Submit. When we press the button, the RadUpload.UploadedFiles.Count is always ZERO and the file never gets uploaded. The page is being refreshed by the submit button during the postback.

Here is the GUI code:

 

<asp:Panel ID="pnlFileUpload" runat="server">

 

Allowed File Extensions are: .jpg, .gif, .bmp, .png

 

<telerik:RadUpload id="RadUpload1" Runat="server" AllowedFileExtensions="jpg, gif, bmp, png" TargetFolder="~\Portals\0\ClientLogos" MaxFileInputsCount="1" >

 

 

</telerik:RadUpload>

 

 

<asp:Button ID="btnUpload" runat="server" Text="Upload" OnClick="btnUpload_Click" />

 

 

</asp:Panel>

 



the btnUpload button is set to UseSubmitBehavior=True. What are we missing?  DotNetNuke version 5.04.02 community.
Waseem
Top achievements
Rank 1
 answered on 24 Nov 2012
4 answers
286 views

When a user clicks on the "Save" button, I want to write a message that says "Saved at [current time]" (like Gmail does when saving a draft).  In order to get the current time I was going to use javascript.  How do I go about calling the Javascript to get the time and displaying it in my label?

Some things to note:

  • I am using ASP.Net 2.0 and the latest build of Promethius
  • I am using a Master Page that has the AjaxManager and my other pages and usercontrols are all using the AjaxManagerProxy controls
  • I only want this message to be set when a certain button is clicked, not on every ajax request.

Any help would be appreciated.

Chuck
Top achievements
Rank 1
 answered on 24 Nov 2012
5 answers
2.1K+ views
I have developped some aspx page with a RadUpload Control.
After setting everything on my dev server, it worked fine
but when uploading it on the prod server, I received the following message after clicking the "Submit" button;

Server Error in Application.     
Could not find a part of the path 'F:\Applications\Upload\Hours\test.txt'.     
Exception Details: System.IO.DirectoryNotFoundException: ... 

My question is; what are the access right requirements for RadUpload to work?
As in an intranet environment, we setted up a generic account for this IIS application with Full rights on this folder but I suspect maybe something with the rights, any hint?

Regards,
David
Waseem
Top achievements
Rank 1
 answered on 24 Nov 2012
8 answers
175 views
Ok,

Been playing with Telerik for a little while, really like it, thinking about purchase but I hit a wall.

I have a content page that has NO update panels just the rad controls and a couple of datalists to display the results...works on my machine and on the server but on the server when we upload a large amount of files it uploads just fine BUT the progress control never finishes on the users screen but the upload does work...I cannot replicate on my dev machine so i cant figure the problem...The control works perfectly on two or three files and its not specific on how many files it takes to fail...

Does this set of controls have issues on GoDaddy?

Code Below,

Thanks!
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div style="width:1200px;margin:0 auto;">
         
        <h1>Upload Listing Images</h1>
        <asp:HyperLink ID="hypReturn" runat="server">Return to Edit Listing Page</asp:HyperLink>
        <br /><br />
 
        <div style="float:left;width:500px;margin:0 50px 0 50px;">
            <telerik:RadProgressManager id="rdProgress1" runat="server" />
 
            <telerik:RadProgressArea ID="pgBar1" runat="server" Language="" />
            <telerik:RadUpload ID="upPics" runat="server" OverwriteExistingFiles="false"
                 AllowedFileExtensions=".jpg,.jpeg,.gif,.jpe" MaxFileSize="5242880" InitialFileInputsCount="5" />
            <br />
            <asp:Button ID="buttonSubmit" runat="server" Text="Upload All" CssClass="RadUploadSubmit"    />
        </div>
 
        <div style="float:left;width:500px;font-size:12px;">
            <asp:Label ID="lblNoResults" runat="server" Visible="true">No Uploaded Files Yet.</asp:Label>
            <asp:Repeater ID="repResults" runat="server" Visible="false">
                <HeaderTemplate>
                    <div>Uploaded Files</div>
                </HeaderTemplate>
                <ItemTemplate>
                    <%#DataBinder.Eval(Container.DataItem, "Filename")%>
                    (<%#DataBinder.Eval(Container.DataItem, "ContentLength").ToString & " bytes"%>)
                    <br />
                </ItemTemplate>
            </asp:Repeater>
            <br />
            <asp:Repeater ID="repInvalidResults" runat="server" Visible="false">
                <HeaderTemplate>
                    <div>Invalid Files</div>
                </HeaderTemplate>
                <ItemTemplate>
                    File: <%#DataBinder.Eval(Container.DataItem, "Filename")%>
                    (<%#DataBinder.Eval(Container.DataItem, "ContentLength").ToString() + " bytes"%>)
                    <br />
                    Mime-type: <%#DataBinder.Eval(Container.DataItem, "ContentType").ToString()%>
                    <br /><br />
                </ItemTemplate>
            </asp:Repeater>
        </div>      
     
     
    </div>   
 
    <div style="clear:both;"></div>
     
</asp:Content>


Imports System
Imports System.Data
Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Drawing.Imaging
Imports System.IO
Imports Telerik.Web.UI
Imports AFOHAB_DAL.AFOHABTableAdapters
 
Public Class upimage
    Inherits System.Web.UI.Page
 
#Region "Globals"
    'destination
    Dim dest As String = Server.MapPath("~/listimgs/")
    Dim ListID As String
#End Region
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        'get listing id otherwise redirect
        ListID = Request.QueryString("ListingID")
 
        If ListID Is Nothing Or ListID = "" Then
            'no data
            Response.Redirect("~/admin/admin.aspx")
        Else
            'continue
 
            'assign return navigate url
            hypReturn.NavigateUrl = "~/admin/listingedit.aspx?id=" & ListID
        End If
    End Sub
 
    Private Sub buttonSubmit_Click(sender As Object, e As System.EventArgs) Handles buttonSubmit.Click
 
        dest = dest & ListID & "\" 'create sub dir based on ListingID
        Dim tbAdp As New tblListing_ImagesTableAdapter 'declare tableadapter to us Images Table
 
        'for each file we will upload and count
        'Dim upf As UploadedFileCollection = upPics.UploadedFiles
 
        If upPics.UploadedFiles.Count > 0 Then
            For Each validfile As UploadedFile In upPics.UploadedFiles
 
                'create directory
                If Not Directory.Exists(dest) Then
                    Directory.CreateDirectory(dest)
                End If
 
                'upfile
                Dim upfile As String = ListID & "-" & validfile.GetName
 
                If File.Exists(dest & upfile) Then
                    'not sure?? threw new exception in old code
                End If
 
                'lower characters
                upfile = upfile.ToLower
 
                ''we need to remove spaces, and other odd characters from file names!!!
                Dim Util As New Utility
                upfile = Util.StripNonAlphaNumericCharacters(upfile)
 
                'reduce length
                If upfile.Length > 40 Then
                    Dim ext As String = upfile.Substring(upfile.LastIndexOf(".") + 1, 3).ToUpper
                    upfile = upfile.Substring(0, 40)
                    upfile = upfile & "." & ext
                End If
 
                'savefile
                validfile.SaveAs(dest & upfile)
 
                'create DB record - if there are no other records for this listing use as main!
                If tbAdp.CountListingImages(ListID) = 0 Then
                    tbAdp.Insert(System.Guid.NewGuid, ListID, "listimgs/" & ListID & "/" & upfile, validfile.GetExtension, True)
                Else
                    tbAdp.Insert(System.Guid.NewGuid, ListID, "listimgs/" & ListID & "/" & upfile, validfile.GetExtension, False)
                End If
 
                '7/2012 - new resize by set image size
                'resize
                'now we need to open the image and resize if nec
                'Dim flOrig As New FileInfo(dest & upfile)
                'Dim flSize As Integer = flOrig.Length / 1024
                Dim flO As String = dest & upfile
                Dim flOt As String = dest & "tmp" & upfile
                'flUpload.Dispose()
 
                'If flSize > 100 Then
                'greater than 100KB then resize
                Dim imgPhoto As Image = ScaleImage(Image.FromFile(flO), 640) 'set width to 560
 
                Dim fExt As String = validfile.GetExtension
                If validfile.GetExtension.ToUpper = ".JPG" Or validfile.GetExtension.ToUpper = ".JPEG" Then
                    imgPhoto.Save(flOt, Imaging.ImageFormat.Jpeg)
                ElseIf validfile.GetExtension.ToUpper = ".GIF" Then
                    imgPhoto.Save(flOt, Imaging.ImageFormat.Gif)
                End If
 
                'imgPhoto.Save(flOt, Imaging.ImageFormat.Jpeg)
                imgPhoto.Dispose()
 
                'overwrite original and delete the temp
                File.Copy(flOt, flO, True)
                File.Delete(flOt)
                'End If
 
            Next
            lblNoResults.Visible = False
            repResults.Visible = True
            repResults.DataSource = upPics.UploadedFiles
            repResults.DataBind()
        Else
            lblNoResults.Visible = True
            repResults.Visible = False
        End If
 
        If upPics.InvalidFiles.Count > 0 Then
            repInvalidResults.Visible = True
            repInvalidResults.DataSource = upPics.InvalidFiles
            repInvalidResults.DataBind()
        End If
    End Sub
 
    Private Shared Function ScaleByPercent(ByVal imgPhoto As Image, ByVal Percent As Integer) As Image
        Dim nPercent As Single = (CSng(Percent) / 100)
 
        Dim sourceWidth As Integer = imgPhoto.Width
        Dim sourceHeight As Integer = imgPhoto.Height
        Dim sourceX As Integer = 0
        Dim sourceY As Integer = 0
 
        Dim destX As Integer = 0
        Dim destY As Integer = 0
        Dim destWidth As Integer = CInt((sourceWidth * nPercent))
        Dim destHeight As Integer = CInt((sourceHeight * nPercent))
 
        Dim bmPhoto As New Bitmap(destWidth, destHeight, PixelFormat.Format24bppRgb)
        bmPhoto.SetResolution(imgPhoto.HorizontalResolution, imgPhoto.VerticalResolution)
 
        Dim grPhoto As Graphics = Graphics.FromImage(bmPhoto)
        grPhoto.InterpolationMode = InterpolationMode.HighQualityBicubic
 
        grPhoto.DrawImage(imgPhoto, New Rectangle(destX, destY, destWidth, destHeight), New Rectangle(sourceX, sourceY, sourceWidth, sourceHeight), GraphicsUnit.Pixel)
 
        grPhoto.Dispose()
        imgPhoto.Dispose()
        Return bmPhoto
    End Function
 
    Private Shared Function ScaleImage(imgPhoto As Image, intNewWidth As Integer) As Image
 
        Dim sourceWidth As Integer = imgPhoto.Width
        Dim sourceHeight As Integer = imgPhoto.Height
        Dim sourceX As Integer = 0
        Dim sourceY As Integer = 0
 
        Dim newHeightPercent As Decimal = intNewWidth / sourceWidth
 
        If newHeightPercent > 1 Then
            'the image is already too small so jsut return the original image
            Return imgPhoto
        Else
            'the image IS too big so resize
            Dim destX As Integer = 0
            Dim destY As Integer = 0
            Dim destWidth As Integer = intNewWidth
            Dim destHeight As Integer = newHeightPercent * sourceHeight
 
            Dim bmPhoto As New Bitmap(destWidth, destHeight, PixelFormat.Format24bppRgb)
            bmPhoto.SetResolution(imgPhoto.HorizontalResolution, imgPhoto.VerticalResolution)
 
            Dim grPhoto As Graphics = Graphics.FromImage(bmPhoto)
            grPhoto.InterpolationMode = InterpolationMode.HighQualityBicubic
 
            grPhoto.DrawImage(imgPhoto, New Rectangle(destX, destY, destWidth, destHeight), New Rectangle(sourceX, sourceY, sourceWidth, sourceHeight), GraphicsUnit.Pixel)
 
            grPhoto.Dispose()
            imgPhoto.Dispose()
            Return bmPhoto
        End If
    End Function
 
End Class
Waseem
Top achievements
Rank 1
 answered on 24 Nov 2012
12 answers
172 views
hi,

I have a radUpload control named "radUp".

When I click on the submit button I call "uploadFile" :
"renameFile" is the new name written by the user on a textbox.
I want to save the file with this name, but I have 2 files on my Directory "Documents" after click: the renamed file and the other .... I want only the renamed file ... what's wrong?

protected void uploadFile()
        {
            if (radUp.UploadedFiles.Count > 0)
            {
                foreach (UploadedFile file in radUp.UploadedFiles)
                {
                    String targetFolder = Server.MapPath("~/Documents");
                    file.SaveAs(Path.Combine(targetFolder, renameFile.Text));
                }
            }
        }

Thanks
Waseem
Top achievements
Rank 1
 answered on 24 Nov 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?