.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

avoid gridview refresh

Posted By:      Posted Date: September 24, 2010    Points: 0   Category :ASP.Net


i designed a gridview, page load event i bind some reocrds to the gridview(the gridview is within Updatepanel only.). after that using JS i have modified the rows data. but one time the page hit row_command event at that time all the modified data by JS was reverted and i can see only the row data which was binded at page_load event. but i want to see the JS data alwayas visible even if its hit server side event,how to do that?

View Complete Post

More Related Resource Links

determine the best way to refresh a gridview when textchanged event occurs


Good afternoon.

I have the following gridview inside an updatepanel that makes the bind from a datatable:

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <asp:Button ID="ButtonAdd" runat="server" OnClick="ButtonAdd_Click" Text="Novo Artigo" />
                <asp:GridView ID="Dados" runat="server" AutoGenerateColumns="False" 
                    CssClass="Grid" Width="100%" CellPadding="4" ForeColor="#333333" 
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                        <asp:Button ID="AbrirModal" runat="server" Text="->" /> 
                                <asp:PopupControlExtender ID="PopupControlExtender1" runat="server"

change value without refresh gridview


Hi Friends,

I am trying to update my count value in gridview once i have click on my link my count value is updated, i am already do this using javascript and also i hv do this change in database and get the proper responce of that.
But i want to do that without refreshing page or gird my count value is increase which is i had.

Try to find out someting..

If any confusion then ask fill free..

Thanking in advance.


How to Refresh Gridview data from update panel in specified time


hello frnds,

i have some search criteria.

after filling all criteria when i press search button the result arrives in gridview nw when searchbutton pressed after that every 20seconds i want 2 update gridview data which is in update panel

GridView - page refresh



I switched from VWD 2010 express (on Win XP) to VS2010 PRO (on Win 7 PRO). I imported a web application (in development) from VWD to VS. 

Now when I "view in browser" an aspx page with a GridView control everytime I select a record entire page reloads (in Win Xp with VWD it didn't).


<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" Width="930px"  
        DataKeyNames="KontaktID" DataSourceID="SqlDataSource1" AllowPaging="True" PageSize="10"  
        AllowSorting="True" onpageindexchanged="GridView1_PageIndexChanged" >
        <AlternatingRowStyle BackColor="#C5C5E2"></AlternatingRowStyle>
        <SelectedRowStyle BackColor="#FFB56A"></SelectedRowStyle>
        <HeaderStyle Height="25px" VerticalAlign="Middle" />
            <asp:CommandField ShowSelectButton="True" SelectText="Izberi" >
                <ItemStyle Width="5%" HorizontalAlign="Center"></ItemStyle>
            <asp:BoundField DataField="ID" HeaderText="id" ReadOnly="T

Gridview refresh after edit?



this one is cracking my brain.
I have a gridview and a formview on one page.
When a row of the gridview is selected, the details will load in the formview.
When i edit the details (f.e. change a name) in that formview and save them, the gridview will just show the old data (=old name).

I have to reload/F5 the page to see the changes in the gridview.
Why isn't the GV updated when i do a databind() in the onclick-event of the update-button in the edittemplate of the formview?

This example is using the northwind database:


<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <form id="form1" runat="server">
    <div style="width: 850px; float: left">
        <asp:SqlDataSource ID="SDS_Products" runat="server" 
            ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>

Questions with GridView/DetailsView Refresh


I have a Gridview that when a record os selected it opens that record in a Detailsviews for Editing, Updating, Inserting and etc.  That is working perfectly but I have two related questions....

1. If I select "New" or "Edit" in the DetailsView I want the cursor to be located in the first field reading for entereing. How can I make this happen?

2. If I update a record selected in the Gridview in the DetailsView, the record is updated in the SQL table but the update is not reflected in the GridView.  Even after refreshing the link the GridView does not display the updated data. How can this be corrected?

All comments appreicated!

get a correct row index after refresh the gridview table


hi all,

i am facing a problem to get a correct row index after i filter the data in table, it always keep the history row index in the table  before i filter. i had a search button to filter the data in gridview,

below is my coding:


 <asp:Button ID="btn_reissue" runat="server" Text="Reissue" CommandName="reissue"  CommandArgument='<%# CType(Container, GridViewRow).RowIndex %>' OnClientClick="return window.confirm('Are you sure you want to reissue this record?');" Width="65px" />


    Protected Sub grdview_rowcommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles gridView1.RowCommand
        Dim cmd As SqlCommand
        If e.CommandName = "reissue" Then
            If Not pUser Is Nothing Then
                pDbUserCon = New SqlConnection(pDbESS)
                pDbUserTrx = pDbUserCon.BeginTransaction()
                    Dim index As Integer = Convert.ToInt32(e.CommandArgument)
                    Dim row As GridViewRow

avoid refresh the same page


hi all,

i had an user cotnrol with some menus like below

<script type="text/javascript">
                                                        stm_bm(["menu0b0f", 850, "", "blank.gif", 0, "", "", 0, 0, 0, 0, 20, 1, 0, 0, "", "", 0, 0, 1, 2, "default", "hand", ""], this);
                                                        stm_bp("p0", [0, 4, 0, 0, 0, 0, 0, 0, 100, "", -2, "", -2, 50, 0, 0, "#999999", "#FFFFF7"]);

Gridview refresh after databound changes


I've been working on a colleagues site, and have been unable to fix a coupld of issues with it.  One of which is a refresh of a Gridview panel.

The page allows a user to navigate a tree structure and then display the permissions on a user selected folder.  Permissions are then added/removed and Saved.

What's not happening is the saved changes aren't being refreshed in the Gridview, also after doing this process once selecting another folder doesn't refresh the Gridview either.

 Below is the sa.aspx file

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="sa.aspx.cs" Inherits="sa" Debug="true" %>

<%@ Register Assembly="System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<%@ Import Namespace="System.Web.Services" %>
<%@ Import Namespace="System.Web.Script.Services" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.

Inplace Edit in GridView

In this article I am presenting a different way to look at EditItemTemplate, using which user navigation for editing is reduced and . it looks very different (see screeen shots) then regular implementation of GridView.

GridView Confirmation Box Using JQuery BlockUI in asp.net

JQuery is the most popular JavaScript library. One of the main reasons for its fame is the plugin architecture. Anyone can create a separate library that leverage the JQuery library. In this article we are going to look at the BlockUI library which is used to block the user screen while performing a task.

Textbox Editable GridView in ASP.NET

This article describes how I made a fully editable gridview in C# using ASP.NET 2. The idea is that the GridView looks and works like an Excel spreadsheet. You see all the cells in the table, and you can edit any of the cells you like, and they are automatically updated (i.e. saved to the database). This is very often how people expect data tables to work in web pages, and I've often seen people clicking in vain on un-editable gridview cells, somehow expecting to edit them, and not understanding that they need to click an Edit button at the end of the row.

Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality

In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I'm going to show on how to delete a certain row in the dynamic GridView with TextBoxes.

AJAX GridView Checkbox Select All in ASP.Net

In the previous article GridView Select Multiple Rows you learnt the multiple row selection in GridView control. Here you will get the C# code sample to select all the gridview rows using single checkbox server control. You can highlight the selected rows with different color and Font state Bold. If you want to use the selection values on different ASP.Net

AJAX GridView Paging and Sorting using C# in ASP.Net

To enable the GridView Paging and Sorting to update the GridView Data without refreshing the ASP.Net web page AJAX Extension controls are used. UpdatePanel is used to hold the GridView control that triggers the events for the controls placed inside it. By Default UpdatePanel triggers the asynchronous postbacks for its child controls.

GridView Paging Using Ajax in ASP.Net

To enable the GridView Paging and Sorting to update the GridView Data without refreshing the ASP.Net web page AJAX Extension controls are used. UpdatePanel is used to hold the GridView control that triggers the events for the controls placed inside it. By Default UpdatePanel triggers the asynchronous postbacks for its child controls.

Displaying Row Details Tooltip on GridView using JQuery

Continuing exploring JQuery! I decided to implement a feature to display some kind of details related to a row displayed on GridView. For example when displaying employees details on GridView some information might not fit in the GridView because it will make it huge and wide. These infomration can be diplayed as Tooltip. Or when you want to display a picture and some kind of formated text to be diplayed as tooltip when mouse hover on the image.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend