This is a migrated thread and some comments may be shown as answers.

Confirm Message after upload file inside radgrid

1 Answer 52 Views
Grid
This is a migrated thread and some comments may be shown as answers.
federic batista
Top achievements
Rank 1
federic batista asked on 09 May 2011, 02:36 PM
Hi there, im trying the telerik controls, and i wanted to know if is possible to trigger an alert after uploading a file in edititem template.


this is my code-behind


Protected Sub rgOferta_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles rgOferta.ItemDataBound
If
TypeOf e.Item Is GridEditFormItem AndAlso e.Item.IsInEditMode Then
            'popup&editform
            Dim edititem As GridEditFormItem = DirectCast(e.Item, GridEditFormItem)
            Dim RadUpload1 As RadUpload = DirectCast(edititem.FindControl("RadUpload1"), RadUpload)
            Dim btns As Button = e.Item.FindControl("btnPrueba")
             Dim estado As String = ""
            If Not btns Is Nothing Then
                If Not RadUpload1 Is Nothing Then
                    estado = UploadFile(RadUpload1)
                    btns.OnClientClick = "showAlert('" & estado & "'); return false;"
                                       
                End If
            End If
        End If
end sub



And this is my javascript which is quite simple.
   function showAlert(valor) {
      alert(valor);
    }

Im using radajaxmanager to ajaxified radgrid.


any help would be appreciated.


regards

1 Answer, 1 is accepted

Sort by
0
Gimmik
Top achievements
Rank 1
answered on 09 May 2011, 10:29 PM
Hi Federic,

The RadGrid actually uses the RadUpload control for its file uploads. There are many client-side events in the RadUpload control that you can wire-up to fire off javascript events (such as an alert!)

Here is the link to the RadUpload client-side programming guide:
http://www.telerik.com/help/aspnet-ajax/upload-client-side-basics.html

You can also utilize the RadProgressManager for more advanced user feedback about uploads. Here is the relevant documentation regarding the RadProgressManager:
http://www.telerik.com/help/aspnet-ajax/upload-progress-radprogressarea.html

Hope this helps!
-Gimmik
Tags
Grid
Asked by
federic batista
Top achievements
Rank 1
Answers by
Gimmik
Top achievements
Rank 1
Share this question
or