Or a way to detect it is finsihed rendering?
或者一种检测它的方法是finsihed渲染?
Actually almost exactly this question
其实几乎就是这个问题
Gridview, is there an event, how would I determine that it has finished being rendered?
Gridview,有一个事件,我如何确定它已经完成渲染?
but he does not state exactly how he detected that everything had been drawn/resized.
但他没有说明他是如何检测到所有内容都被绘制/调整大小的。
EDIT: (Adding my comment from below to specify what i am trying to do)
编辑:(从下面添加我的评论,以指定我想做什么)
I am trying to create a work around for static header for a gridview by basically dynamically adding another gridview above the one that actually has the data in it. I resorted to this after trying about 12 different suggestions/solutions with no real luck. What i have works pretty well except that the new header is rendered before the one with the data in it completes its re-sizing, I realize what i am trying might not even work since it might require another postback to re-render the new one after i find the sizes of the column headers but thought i might get around that with an update panel.
我试图通过基本上动态地在实际具有数据的那个上面添加另一个gridview来为gridview创建静态头的工作。在尝试了大约12种不同的建议/解决方案后,我没有真正的运气。我的工作非常好,除了新的标头在其中的数据之前呈现完成其重新调整大小,我意识到我正在尝试甚至可能不工作,因为它可能需要另一个回发来重新渲染新的在我找到列标题的大小之后,我想我可以使用更新面板来解决这个问题。
I realize this might not be the most elegant solution but honestly have yet to find any solutions to this problem that come even close to elegant or have even worked correctly with current browsers.
我意识到这可能不是最优雅的解决方案,但老实说还没有找到任何解决方案,这个问题甚至接近优雅或者甚至可以正常使用当前的浏览器。
2 个解决方案
#1
1
It renders at the client so the server doesn't know what is happening there.
它在客户端呈现,因此服务器不知道那里发生了什么。
You are probably looking for the DataBound
event.
您可能正在寻找DataBound事件。
Otherwise, at the client, you can determine when the page has finished loading (the jquery ready function) and then call back to the server. But I can't imagine anything useful you could do. If you send more data to the client and it renders again, you could have an infinite loop.
否则,在客户端,您可以确定页面何时完成加载(jquery ready函数),然后回调服务器。但我无法想象你能做些什么。如果您向客户端发送更多数据并再次呈现,则可能会出现无限循环。
#2
0
Everything in an ASP.Net webpage is rendered at the same consecutively at the same stage of the lifecycle (see http://msdn.microsoft.com/en-us/library/ms178472.aspx), so the Gridview will be rendered between Gridview_PreRenderComplete
and Gridview_Unload
.
ASP.Net网页中的所有内容在生命周期的同一阶段连续呈现(请参阅http://msdn.microsoft.com/en-us/library/ms178472.aspx),因此Gridview将在两者之间呈现Gridview_PreRenderComplete和Gridview_Unload。
You page PreRender
will fire, then the control PreRender
, then the page will call the Gridview Render method (there is no event for this) then the control Unload
will fire and then the page Unload
will fire.
您的页面PreRender将触发,然后控制PreRender,然后页面将调用Gridview Render方法(没有此事件)然后控件Unload将触发,然后页面Unload将触发。
Other posters to this question are referring to the client side rendering whereas I am referring to the server side rendering process. Which is it that you are actually after and why please?
此问题的其他海报是指客户端渲染,而我指的是服务器端渲染过程。你实际上在追求的是什么,为什么请?
#1
1
It renders at the client so the server doesn't know what is happening there.
它在客户端呈现,因此服务器不知道那里发生了什么。
You are probably looking for the DataBound
event.
您可能正在寻找DataBound事件。
Otherwise, at the client, you can determine when the page has finished loading (the jquery ready function) and then call back to the server. But I can't imagine anything useful you could do. If you send more data to the client and it renders again, you could have an infinite loop.
否则,在客户端,您可以确定页面何时完成加载(jquery ready函数),然后回调服务器。但我无法想象你能做些什么。如果您向客户端发送更多数据并再次呈现,则可能会出现无限循环。
#2
0
Everything in an ASP.Net webpage is rendered at the same consecutively at the same stage of the lifecycle (see http://msdn.microsoft.com/en-us/library/ms178472.aspx), so the Gridview will be rendered between Gridview_PreRenderComplete
and Gridview_Unload
.
ASP.Net网页中的所有内容在生命周期的同一阶段连续呈现(请参阅http://msdn.microsoft.com/en-us/library/ms178472.aspx),因此Gridview将在两者之间呈现Gridview_PreRenderComplete和Gridview_Unload。
You page PreRender
will fire, then the control PreRender
, then the page will call the Gridview Render method (there is no event for this) then the control Unload
will fire and then the page Unload
will fire.
您的页面PreRender将触发,然后控制PreRender,然后页面将调用Gridview Render方法(没有此事件)然后控件Unload将触发,然后页面Unload将触发。
Other posters to this question are referring to the client side rendering whereas I am referring to the server side rendering process. Which is it that you are actually after and why please?
此问题的其他海报是指客户端渲染,而我指的是服务器端渲染过程。你实际上在追求的是什么,为什么请?