Ajax with Grid Update Not Working

8 posts, 0 answers
  1. Rita15
    Rita15 avatar
    19 posts
    Member since:
    Feb 2010

    Posted 12 Mar 2010 Link to this post

    Hi,

       I am using RadGrid to display items. I use webusercontrol to edit Grid data. Everything was working fine.
    After I added Ajax, the Grid Works fine, but the Update/delete is not working. I also use <asp:LinkButton for showing the edit form.

    Can someone please help me?

    <MasterTableView DataKeyNames="IDR_ID" GridLines="None" Width="100%" CommandItemDisplay ="Top" InsertItemDisplay="Top" InsertItemPageIndexAction="ShowItemOnCurrentPage">   
                  <CommandItemTemplate> 
                        <div style="padding: 5px 5px;"
                            &nbsp;&nbsp;&nbsp;&nbsp; 
                            <asp:LinkButton ID="btnEditSelected" runat="server" CommandName="EditSelected" Visible='<%# RadGrid1.EditIndexes.Count == 0 %>'><b>Edit selected</b></asp:LinkButton>&nbsp;&nbsp;&nbsp;&nbsp; 
                            <asp:LinkButton ID="btnCancel" runat="server" CommandName="CancelAll" Visible='<%# RadGrid1.EditIndexes.Count > 0 || RadGrid1.MasterTableView.IsItemInserted %>'><b>Cancel editing</b></asp:LinkButton>&nbsp;&nbsp; 
                            <asp:LinkButton ID="LinkButton2" runat="server" CommandName="InitInsert" Visible='<%# !RadGrid1.MasterTableView.IsItemInserted %>'><b>Add new</b></asp:LinkButton>&nbsp;&nbsp;&nbsp;&nbsp; 
                            <asp:LinkButton ID="LinkButton1" OnClientClick="javascript:return confirm('Delete selected IDR?')" runat="server" CommandName="DeleteSelected"><b>Delete selected IDR</b></asp:LinkButton>&nbsp;&nbsp; 
                            <asp:LinkButton ID="LinkButton4" runat="server" CommandName="RebindGrid"><b>Refresh IDR list</b></asp:LinkButton> 
                        </div> 
                    </CommandItemTemplate>  


    Thanks,
    Rita



  2. robertw102
    robertw102 avatar
    265 posts
    Member since:
    Jul 2007

    Posted 12 Mar 2010 Link to this post

    Is the user control you use to update/delete also ajaxified? That could be the issue.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Rita15
    Rita15 avatar
    19 posts
    Member since:
    Feb 2010

    Posted 12 Mar 2010 Link to this post

    Yes, the user Control I use to update/delete is also ajaxified. Does that mean I can not ajaxify user control ??
    If I can ajaxify the user control, can you please help me how to do that?

    The current ajax code  inside the web user control is:
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server"
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="FName"
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="FName" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManagerProxy> 
    <script language="javascript" type="text/javascript"
     

    Thanks,
    Rita
  5. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 15 Mar 2010 Link to this post

    Hi Rita15,

    If by user control, you mean that you are using it for the edit form of the grid, then indeed you need to remove the ajaxification of the user control as it is not needed. It is sufficient to ajaxify the whole grid in order to get all grid's operations to perform seamlessly without any browser flickering.

    I hope this helps.

    Regards,
    Tsvetoslav
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  6. Rita15
    Rita15 avatar
    19 posts
    Member since:
    Feb 2010

    Posted 16 Mar 2010 Link to this post

    Hi,

    Thanks for the response.

    here is what I am trying to do.
    ---------------------------------------------------------------------------------------------------------------
    In the web page, there are 3 set of controls.
    1) RadGrid 
    2) A group of asp:LinkButton buttons OUTSIDE OF RADGRID( These are like ADD,UPDATE,DELETE buttons)
    3) Other RadControls OUTSIDE OFRADGRID (Which shows Grid row related data )

    When the selectedINdex of RadGrid Changes , I need to show the Grid row related data in No( 3)  Other RadControls OUTSIDE OF RADGRID

    When  asp:LinkButton edit/Add button is clicked I want to show the web user control edit form.

    I want to ajaxify each set of controls when any one(1) RadGrid ,2) A group of asp:LinkButton buttons,3) Other RadControls ) gets changed. 
    -------------------------------------------------------------------------------------------------------------------------
    Also is there a way to axafify RadGrid outside of RadGrid??? For example, when the edit/add link button is clicked, The RadGrid needs to be ajaxified.

    Thanks!



  7. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 18 Mar 2010 Link to this post

    Hi Rita,

    Concerning the ajaxification issue, you can achieve in a couple of ways. Either by wrapping all the controls in a single RadAjaxPanel or through the RadAjaxManager adding the corresponding ajax settings. For example, if you need the grid to enter edit mode upon clicking the edit button and this being done through an ajax request, then (supposing your edit button has and ID of "btnEdit") your ajax setting for these two controls should be as follows:

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

    and the code for putting the selected item in edit mode should be:

    protected void btnEdit_Click(object sender, EventArgs e)
    {
        RadGrid1.SelectedItems[0].Edit = true;
        RadGrid1.Rebind();
    }


    Regards,
    Tsvetoslav
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  8. Rita15
    Rita15 avatar
    19 posts
    Member since:
    Feb 2010

    Posted 18 Mar 2010 Link to this post

    Hi,

    Thanks for the reply!

    I am using Master Pages and the script Manager is in the Master page. So could you please give an example how to do that?

    Thanks!

  9. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 23 Mar 2010 Link to this post

    Hello Rita,

    Just put the RadAjaxManager control on the master page and on the content pages add RadAjaxManagerProxy controls configuring their settings exactly as you should have done for the RadAjaxManager control and as shown in my previous post.
    More informaion you can find the following help topics:
    http://www.telerik.com/help/aspnet-ajax/ajax-manager-proxy.html
    http://www.telerik.com/help/aspnet-ajax/ajxajaxmanager.html


    All the best,
    Tsvetoslav
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017