It was an experimental work and I could able to store my GridView in a ThreadStatic variable and also able to bind it in a WebMethod like below.

private static GridView purchaseItemsAddGridView;

purchaseItemsAddGridView = this.GridView1;

[WebMethod(EnableSession = true)]
public static List<Product> GetProductsRefresh(List<Product> productList)

                purchaseItemsAddGridView.DataSource = productList;
                purchaseItemsAddGridView.Visible = true;
                return productList;

function updateGrid() {
            var totalRows = $.parseJSON(sessionStorage.getItem('items'));
                type: "POST",
                url: "Default.aspx/GetProductsRefresh",
                data: JSON.stringify({ productList: totalRows }),
                success: success,
                dataType: "json",
                async: false,
                contentType: "application/json; charset=utf-8",
                error: function (e) {


I could able to push the data to my web method by taking it from a local storage and also able to execute the GridView bind. I also verified the GridView property and seeing the new rows inside it. But UI not refreshed with latest rows. Any ways to update my grid UI so that latest number of rows would be displayed.

Related posts

Recent Viewed