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

Use javascript to refresh grid

3 Answers 705 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Declan
Top achievements
Rank 2
Declan asked on 06 Nov 2008, 02:56 PM
Simple I thought but I can't get any success:(

What I am trying to achieve is that when a radWindow closes the grid refreshes.

I use a radWindow opened by a button in a grid row to allow uploads of files to be associated with the row. When the upload completes the user closes the upload window and I then want to refresh the grid in order to show the names of the files uploaded in a grid cell.

The upload updates the database table with the names of the uploaded files.

tow attempts that fail -

 
function onClientClose(radWindow) {  
    alert('ClientClosed');  
    var masterTable = $find("<%= grd.ClientID %>").get_masterTableView();  
    masterTable.dataBind();  
    
//    window('<%=grd.ClientID %>').AjaxRequest('<%= grd.UniqueID %>', 'ResetAndRebind');  
}  
 

Declan

3 Answers, 1 is accepted

Sort by
0
Declan
Top achievements
Rank 2
answered on 06 Nov 2008, 03:16 PM
Whit a little cut/paste from page source I find that this works:

 
__doPostBack('dnn$ctr371$View$grdwindow$grd$ctl00$ctl02$ctl00$RebindGridButton''')  
 

I could change it to:

 
__doPostBack("<%= grd.ClientID %>"'')  
 

and add the id for the RebindButton. This, of course assumes I have a RebindGridButton but I don't want one!

There must be some other way. Do I need a hidden control to do postback on that fires NeedDataSource or similar?


0
Vlad
Telerik team
answered on 06 Nov 2008, 03:22 PM
Hi Declan ,

You can call:
 $find("<%= grd.ClientID %>").get_masterTableView().rebind();

Kind regards,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Declan
Top achievements
Rank 2
answered on 06 Nov 2008, 03:26 PM
So simple in the end:)

Thanks Vlad.

PS - the new site is nice.
Tags
Grid
Asked by
Declan
Top achievements
Rank 2
Answers by
Declan
Top achievements
Rank 2
Vlad
Telerik team
Share this question
or