Close button and refreshGrid

12 posts, 0 answers
  1. NS
    NS avatar
    179 posts
    Member since:
    Jan 2007

    Posted 14 Jan 2008 Link to this post

    Hello,
    Using the regular telerik asp.net grid, I had a RadWindow that contains detail items of a record. (opens when clicking an item in a grid).

    On the RadWindow, there is a button "Close this window". When hitting this button, the grid on the parent page automatically reloads its records. (this was done using: CloseAndRebind() and refreshGrid (javascript) as described in the Help files.

    My question is how to do this with the Prometheus grid ?

    Thanks,
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 14 Jan 2008 Link to this post

    Hello NS,

    You can use fireCommand() client-side method to achieve this. Here is an example:

    http://www.telerik.com/help/radcontrols/prometheus/grid_fireCommand.html

    function refreshGrid()
    {
      $find("<%= RadGrid1.MasterTableView.ClientID %>").fireCommand("RebindGrid","");
    }

    All the best,
    Vlad
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. NS
    NS avatar
    179 posts
    Member since:
    Jan 2007

    Posted 14 Jan 2008 Link to this post

    Thanks the fireCommand method works :-)

    Another question:
    is there some way to encapsulate or call the fireCommand method in an Ajax request ? (because calling the fireCommand command causes a postback of my page)
  5. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 14 Jan 2008 Link to this post

    Hi NS,

    If you ajaxify the grid using RadAjaxManager or panel all grid methods will be affected as well. Here is an example:

            <telerik:RadAjaxManager ID="RadAjaxManager1"
                    runat="server">
                    <AjaxSettings>
                        <telerik:AjaxSetting AjaxControlID="RadGrid1">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                    </AjaxSettings>
                </telerik:RadAjaxManager>

    Kind regards,
    Vlad
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. Roel
    Roel avatar
    13 posts
    Member since:
    Dec 2007

    Posted 15 Jan 2008 Link to this post

    Hi,

    I have the same set-up, but I am using the Prometheus "Futures" built.

    However, the function below results in the error: "Object doesn't support this property or method"

    function refreshGrid()

    {

    var masterTable = $find("<%= gridItems.ClientID %>").get_masterTableView();

    masterTable.fireCommand(

    "RebindGrid","");

    }

    The function refreshGrid is inside a telerik radcodeblock.

    What am I doing wrong?

    Regards
    Roel

  7. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 16 Jan 2008 Link to this post

    Hello Roel,

    Please excuse us if our previous reply confused you as it seems we made a mistake here. Actually such argument for the fireCommand client method is not supported and we plan to implement rebind client method which to invoke implicitly the server-side Rebind() method of RadGrid. This will most probably be included in the next version of RadGrid Prometheus.

    In the meantime you may consider ajaxifying the grid through RadAjaxManager, trigger ajax request using the AjaxRequest(eventArgs) method of the manager and rebind the grid on the server inside the AjaxRequest handler.

    Best regards,
    Stephen
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  8. Roel
    Roel avatar
    13 posts
    Member since:
    Dec 2007

    Posted 16 Jan 2008 Link to this post

    Hi,

    I have tried Ajaxifying, but that didn't work.

    I have defined the RadAjaxManager as:

    <telerik:RadAjaxManager
        ID="RadAjaxManager1" 
        runat="server" >
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="cboUsers">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="gridItems" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="gridItems">            
                <
    UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="gridItems" />
                
    </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

    The client script to trigger the ajax request:

    function refreshGrid()
    {
        var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
        ajaxManager.AjaxRequest();
    }

    And the server side event handler:

    Protected Sub RadAjaxManager1_AjaxRequest( _
            
    ByVal sender As Object, _
            ByVal e As Telerik.Web.UI.AjaxRequestEventArgs) _
        Handles RadAjaxManager1.AjaxRequest
        
        Me
    .gridItems.Rebind()

    End Sub

    Debugging: the code hits the refreshGrid function and subsequent the AjaxRequest event handler. I can see the data is being reloaded, but when the page is finished the grid is not updated. There are no script errors reported. After a manual refresh of the page the correct data is displayed. The page is inside a masterpage

    Any clues?

  9. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 16 Jan 2008 Link to this post

    Hi Roel,

    Can you please confirm that you are using the latest hotfix of RadControls Prometheus (Q3 2007 SP1) released yesterday? If the issue is not solved, I suggest you prepare a small working version of your project and send it enclosed to a formal support ticket. We will debug it locally and will get around to you with more info on the subject.

    Best regards,
    Stephen
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  10. Jeff
    Jeff avatar
    33 posts
    Member since:
    Sep 2006

    Posted 16 Jan 2008 Link to this post

    Can you post this answer here as well? I opened a support ticket earlier for something similar, and also wanted to refresh the grid after closing.

    Thanks,
    Jeff
  11. Roel
    Roel avatar
    13 posts
    Member since:
    Dec 2007

    Posted 17 Jan 2008 Link to this post

    Hi,

    I have installed the 2007 3 1314 hotfix, but without effect.

    I will create a small sample application and create a support ticket.

    Roiel
  12. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 17 Jan 2008 Link to this post

    Hello Roel,

    We will be expecting your example, feel free to post it in a support ticket once you are ready with it.

    Kind regards,
    Stephen
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  13. Roel
    Roel avatar
    13 posts
    Member since:
    Dec 2007

    Posted 17 Jan 2008 Link to this post

    Hi Jeff,

    The solution for my issue was simple: there was only one AjaxSetting missing, see the part in bold.

    feedback from Telerik:
    When you use the client-side AjaxRequest() method, initiator would be the respective Ajax control you use. So according to these, you need to add the following ajax setting in your AjaxManager:

    see also http://www.telerik.com/help/aspnet/ajax/?ajxClientSideAPI.html

    <
    telerik:RadAjaxManager 
        ID="RadAjaxManager1" 
        runat="server" 
        
    <AjaxSettings>

            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                
    <UpdatedControls
    >
                    <telerik:AjaxUpdatedControl ControlID="gridItems" />

                
    </UpdatedControls>
             </telerik:AjaxSetting
    >

             <
    telerik:AjaxSetting AjaxControlID="cboUsers">
                 <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="gridItems" />
                </UpdatedControls>
             </telerik:AjaxSetting>
         </AjaxSettings>
    </telerik:RadAjaxManager>

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