.NET Framework Bookmark and Share   
 index > Network Class Library (System.Net) > How to refresh GridView after inserting data
 

How to refresh GridView after inserting data

Hi,
I have a gridView. Also I have put adetailView inside the EmptyDataTemplate of the GridView to insert data into the GridView when there is no record. The DetaisView appears when user click Add(beside the Edit button) in the GridView. In the DetailsView I can insert data by entering values in the textboxs and clicking the Insert button. My problem is, the GridView is not coming back. What doI have to do, so that after clicking insert theGridView wil appear with the new data?
In the code page I have following code:

Partial

Class Details

Inherits System.Web.UI.Page

Protected Sub gvDeferredDt_RowCommand(ByVal sender As Object, _

ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) _

Handles gvDeferredDt.RowCommand

If e.CommandName = "Add" Then

gvDeferredDt.DataSourceID =

""

gvDeferredDt.DataBind()

End If

End Sub

Protected Sub dtvInsertDefferedDt_ItemInserted(ByVal sender As Object, _

ByVal e As System.Web.UI.WebControls.DetailsViewInsertedEventArgs)

gvDeferredDt.DataSourceID =

"odsrcDeferredDt"

gvDeferredDt.DataBind()

End Sub

Thanks,
  •  
Aalo

Offtopic. Your question should somehow be related to the class in theSystem.Net namespace.

Oleksii Prokopchuk [NCL]

Offtopic. Your question should somehow be related to the class in theSystem.Net namespace.

Oleksii Prokopchuk [NCL]

You can use google to search for other answers

Custom Search

More Threads

• System.Net.Mail SMTP Fails to Request Connection with Server
• WebException
• Retrieving Chunked HTTP
• Can TCP segments be broken up and delivered seperately?
• SSL wiht TcpClient
• Dns.GetHostEntry(server) does not work sometimes, however Dns.GetHostByAddress(server) does
• About the Socket.SendPacketsAsync() method...
• Not receiving extended ASCII characters correctly on UDP socket
• Ftpwebrequest.EndGETREQUESTSTREAM.Close() hangs and doesnot responds
• Post HTTP Headers to log into forums