Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > BinaryImage > Error - Multiple image upload in single record through grid and binary image example

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

Feed from this thread
  • Posted on May 11, 2011 (permalink)

    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);
                            }
         }
    }

    Reply

  • Radoslav Radoslav avatar

    Posted on May 16, 2011 (permalink)

    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.

    Attached files

    Reply

  • Arun Kumar avatar

    Posted on Aug 19, 2011 (permalink)

    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

    Reply

  • Radoslav Radoslav avatar

    Posted on Aug 24, 2011 (permalink)

    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 >>

    Reply

  • Velissarios avatar

    Posted on Aug 25, 2011 (permalink)

    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

    Reply

  • Radoslav Radoslav avatar

    Posted on Aug 30, 2011 (permalink)

    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 >>

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > BinaryImage > Error - Multiple image upload in single record through grid and binary image example