开发者

Gridview inside UpdatePanel refresh

开发者 https://www.devze.com 2022-12-24 06:28 出处:网络
I use a GridView to represent data from a table in my DB. the GridView has some template fields whose content are determined before displaying the Grid ( I use the RowDataBound event to determine con

I use a GridView to represent data from a table in my DB.

the GridView has some template fields whose content are determined before displaying the Grid ( I use the RowDataBound event to determine content of template fields before displaying the GridView).

The page displays a list of records from the table records and then, the recording process starts. after the process is over, the template fields should be updated.

how do I automatically refresh the GridView after the process is finished ? it should be noted that the GridView is contained within an control and that I continuously poll the server using a Timer control that executes "GridView1.DataBind()" at the server level every 60 seconds.

since the GridView is inside an UpdatePanel, calling DataBind() method on i开发者_开发知识库t doesn't seem to call the RowDataBound event.

How can I solve this ?


Yes, thats enough to call the GridView1.DataBind() Method in a particular time interval lapses using the Timer control, but before calling the DataBind() method, have you assigned the updated data source for the Gridview ? For eg; When the page loads you are drawing the gridview using a Dataset named "EmployeeDS". so after some update, you need to update the local dataset like below to the gridview, then call the DataBind() method.

GridView1.DataSource = EmployeeDS.Table[0];
GridView1.DataBind();
0

精彩评论

暂无评论...
验证码 换一张
取 消