How to bind gridview after Page_Load?
I want to bind a gridview after the page has finished load开发者_JAVA技巧ing (after Page_Load), so not on the Page_Load event handler, but after that.
Protected Sub Page_LoadComplete(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LoadComplete
If Not IsPostBack Then
Me.DataBind()
End If
End Sub
Public Overrides Sub DataBind()
Me.Grid.Datasource = Somedata
MyBase.DataBind()
End Sub
Is that what you mean?
I'm not quite sure what you mean. The Gridview is bound to a datasource on the server side. You can bind the source at any point between Page_Init
and the end of Page_Load
, if I recall correctly.
jQuery on the other hand runs on the client side and therefore binding a datasource to the Gridview at this point is not possible.
精彩评论