jQWidgets Forums

jQuery UI Widgets Forums ASP .NET MVC How to update data from the code behind using updatebounddata in c#?

This topic contains 1 reply, has 2 voices, and was last updated by  Hristo 5 years, 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • Novato
    Participant

    Hello I hope you can help me with this thank you very much.

    I have a form where when I click on my search button it shows me my grid, this works perfectly.

    After consulting the data I press a button to select an excel file and display it in a grid so the previous grid I hide it with css, this also works perfectly.

    Finally I click on an asp button to update the data in my database so I hide my grid where I show the excel file and show my main data grid with css but the data in this grid is not updated so I need to update the main grid in the code behind in C#

    How can I do this?

    This is mi codigo:

    
     protected void ButtonUpdate_Click(object sender, EventArgs e)
            {
    
                ///******** Here I hide the grid where I show the excel data
                    string hide_grid_excel = @"$(""[id*='grid_ExcelData']"").css('display', 'none');";
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "hide_grid", hide_grid_excel , true);
    
                ///****** Here I want to update it before displaying it but the grid is not updated.
                    string update_grid_data = @"$('#gvData').jqxGrid('updatebounddata');";
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "update_grid", update_grid_data , true); 
    
               ///******** Here I show again the main data grid but it is shown without updating.
                    string show_grid_data = @"$('#gvData').css('display', 'block');";
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "show_grid ", show_grid_data , true);
            }
    

    Hristo
    Participant

    Hello Novato,

    Is there any error message in the console?
    If not I would like to suggest you try to slow down the second and the third action (setTimeout – Thread.Sleep).

    Best Regards,
    Hristo Hristov

    jQWidgets team
    https://www.jqwidgets.com

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.