RadImageEditor Image Loading

4 posts, 1 answers
  1. Rodrigo
    Rodrigo avatar
    7 posts
    Member since:
    Jan 2011

    Posted 15 Jun 2015 Link to this post

    Hello,

     I am working with 2 of telerik web controls RadTreeList and RadImageEditor, the thing here is that I'm havving some trouble when using both.

    First I bind my radtreelist within the database and here is when the image editor starts working, when I select a row from the radtreelist i get the ID and some information needed in order to bind information, this information includes an Image. The first time I select an Item from the radtreelist the imageEditor works fine but when I select another Item the radImageEditor does not reload the image and the displayed image is the one of the first selected item.

    Can somebody help me on this please?

    If more information is needed please let me know it

  2. Answer
    Vessy
    Admin
    Vessy avatar
    1381 posts

    Posted 18 Jun 2015 Link to this post

    Hi Rodrigo,

    A possible reason for the experienced issue could be if the browser is caching the initially loaded image. What approch are you using to load the target images from the DataBase to the ImageEditor? Are you doing it by using a MemoryStream in the ImageLoading event?

    Can you open a primary support ticket and attach a simplified version of your project so we can reproduce and examine the problem on our side?

    Regards,
    Vessy
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Rodrigo
    Rodrigo avatar
    7 posts
    Member since:
    Jan 2011

    Posted 18 Jun 2015 in reply to Vessy Link to this post

    HI Vessy,

    I'm using a MemoryStream in Loading event.

    I've solve my problem, I just have to a line in order to perform the required action

    RadImageEditor1.ResetChanges(); /*this line was added*/
    filename = Path.Combine(filename, image);
    MemoryStream mstream = new MemoryStream(File.ReadAllBytes(filename));

    Telerik.Web.UI.ImageEditor.EditableImage img = new Telerik.Web.UI.ImageEditor.EditableImage(mstream);
    args.Image = img;
    args.Cancel = true;
    //Handle Uploaded images

    if (!Object.Equals(Context.Cache.Get(Session.SessionID + "UploadedFile"), null))
    {
    if (radTxtEquipo.Text != "")
    {
    using (EditableImage image = new EditableImage((MemoryStream)Context.Cache.Remove(Session.SessionID + "UploadedFile")))
    {
    args.Image = image.Clone();
    args.Cancel = true;
    }
    string fullPath = Server.MapPath("/Element/");
    string nombre = RadImageEditor1.ExtractFileNameFromImageUrl();
    string fileName = string.Format("element-{0}.jpg", radTxtEquipo.Text);//, DateTime.Now.ToString("yyyyMMdd-hhmmss"));
    fullPath = Path.Combine(fullPath, fileName);
    Telerik.Web.UI.ImageEditor.EditableImage img = args.Image;
    img.Image.Save(fullPath);
    RadWindowManager1.RadAlert("OK", 330, 150, "Application Alert", "alertCallBackFn");

     

    Thanks in advance

     

     

  5. Vessy
    Admin
    Vessy avatar
    1381 posts

    Posted 19 Jun 2015 Link to this post

    Hi Rodrigo,

    I am glad you managed to pinpoint the missing part of the ImageLoading logic and now images are loaded properly. Feel free to contact us again in case any further question on this matter occurs.

    Regards,
    Vessy
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top