get UploadedFileContent from codebehind

2 posts, 0 answers
  1. armando
    armando avatar
    4 posts
    Member since:
    Sep 2008

    Posted 28 Oct 2009 Link to this post

    Hi, I'm working with a grid and when I go  in the updateCommand  procedure, I try to get the uploadFileContent, but alwasy is null, some one can help me? I have this code.
     Protected Sub gridGaleria_UpdateCommand(ByVal source As ObjectByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles gridGaleria.UpdateCommand 
            If TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode Then 
                Dim editItem As GridEditableItem = DirectCast(e.Item, GridEditableItem) 
                Dim upload As GridBinaryImageColumnEditor = DirectCast(editItem.EditManager.GetColumnEditor("Upload"), GridBinaryImageColumnEditor) 
                Dim db As New aulaDataContext 
                If upload.UploadedFileContent.Count > 0 Then 
                    Dim evenFoto = From ev In db.eventosFotos _ 
                               Where ev.idEventoFoto = 1 _ 
                               Select ev 
                    For Each renglon In evenFoto 
                        renglon.pathArchivo =     upload.RadUploadControl.UploadedFiles.Item(0).FileName 
                End If 
            End If 
        End Sub 

  2. Sebastian
    Sebastian avatar
    9934 posts

    Posted 29 Oct 2009 Link to this post

    Hello armando,

    In case you ajaxified your grid via RadAjaxManager or RadAjaxPanel, can you please verify that you disable the ajax explicitly as illustrates on this online demo of the product? Thus the UploadedFileContent property should contain the necessary data.

    Best regards,

    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top