Error - Multiple image upload in single record through grid and binary image example

6 posts, 0 answers
  1. Aamir Ali Ansari
    Aamir Ali Ansari avatar
    22 posts
    Member since:
    Jun 2010

    Posted 11 May 2011 Link to this post

    I am using your sample code to upload image to the database.
    http://demos.telerik.com/aspnet-ajax/controls/examples/integration/raduploadinajaxifiedgrid/defaultcs.aspx

    The example works fine when i am using only one image upload feature. Since my table has three image columns for different reasons, I am unable to modify the code for inclusion of multiple uploads for each column. Can u share any sample code as i am getting an error "System.InvalidCastException: Object must implement IConvertible.". I am unable to fix it. I am trying below mentioned code.

       function conditionalPostback(sender, eventArgs) {
                        var theRegexp = new RegExp("\.UpdateButton$|\.PerformInsertButton$", "ig");
                        if (eventArgs.get_eventTarget().match(theRegexp)) {
                            var upload = $find(window['UploadId']);
                            var uploadmid = $find(window['UploadIdMid']);
                            var uploadthumb = $find(window['UploadIdThumb']);
      
    //                         Test script for all
                            if (upload.getFileInputs()[0].value != "" || uploadmid.getFileInputs()[0].value != "" || uploadthumb.getFileInputs()[0].value != "") {
                                eventArgs.set_enableAjax(false);
                            }
         }
    }
  2. Radoslav
    Admin
    Radoslav avatar
    1564 posts

    Posted 16 May 2011 Link to this post

    Hi Aamir,

    I am sending you a simple example which demonstrates the desired functionality. Please check it out and let me know if it helps you.

    Best wishes,
    Radoslav
    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. Arun Kumar
    Arun Kumar avatar
    1 posts
    Member since:
    Aug 2011

    Posted 19 Aug 2011 Link to this post

    Hi,
    I have RadGrid with one GridBinaryImageColumn, When the user clicks Select button, couldn't able to select multiple Images.

    Can you please tell me a way of choosing/selecting multiple imagesby using only one GridBinaryImageColumn.


    Appreciate your help and support.

    Thanks,
    Arun
  5. Radoslav
    Admin
    Radoslav avatar
    1564 posts

    Posted 24 Aug 2011 Link to this post

    Hi Arun,

    The RadGrid does not support uploading multiple images in one GridBinaryImageColumn when the grid is bound via DataSource control and the automatic operations are used.
     
    In order to achieve the desired functionality you could try using the GridTemaplateColumn with RadBinaryImage control into its ItemTemplate and RadUpload into its EditItemTemplate.
    However in this case you need to handle all CRUD operations manually.  On the following link you could find online example which demonstrates Grid Manual Operations:
    http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandradasyncupload/defaultcs.aspx?product=grid

    I hope this helps.

    Greetings,
    Radoslav
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  6. Velissarios
    Velissarios avatar
    8 posts
    Member since:
    Jun 2011

    Posted 25 Aug 2011 Link to this post

    Hello to all

    In this example you gave, it is mandatory to add the 3 images in order to continue.

    Is it possible to explain to me, how I can achive to enter - for example- the first binary image into the database, leave the other images without any image file and if someone needs later, can insert the other images, leaving the first one intact?

    Yours
    Velissarios
    vhousos@gmail.com

  7. Radoslav
    Admin
    Radoslav avatar
    1564 posts

    Posted 30 Aug 2011 Link to this post

    Hi Velissarios,

    To achieve the desired functionality you need to have three binary columns into your database. In edit mode you could show a RadUpload with three inputs. Then into the code behind you could get the uploaded images and update the corresponding database columns.
    To distinguish files uploaded from the different inputs you could try using the approach described in the following online documentation article:
    Adding Information to Uploaded Files

    I hope this helps.

    Kind regards,
    Radoslav
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017