Gridview, is there an event, how would I determine that it has finished being rendered?

那年仲夏 提交于 2019-12-13 07:28:02

问题


Gridview, is there an event, how would I determine that it has finished being rendered? That's basically it, I want to adjust the height of some other controls on the page and I want to pick up this event.

Sorry I should have been more explicit in stating that this is actually a web page not a winform. In the end I managed to solve the problem by registering a function with the page load which is called after the controls have been drawn and they calling the gridview size and resizing the other controls to fit. It works and that is that.

Thanks.


回答1:


The GridView inherits from Control so you can use any of the events, I would try PreRender, it seams it will provide you with what you need




回答2:


To see all the GridView events available to you;

In Design Mode, select the gridview and click F4. In the properties window there is a 'lighting' tab which lists all gridview events you can attach to.




回答3:


Assuming you are in winforms, the best place to do it would be after you bind data to your grid, in the DataBindingComplete event.




回答4:


Managed to solve it, see details above.



来源:https://stackoverflow.com/questions/5037206/gridview-is-there-an-event-how-would-i-determine-that-it-has-finished-being-re

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!