How can I invoke Server Side Event InitializeLayout programmatically?

5 replies. Last post: April 27, 2010 11:55 AM by Glenn Layaar
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback

How can I invoke the Serve Side Event InitializeLayout programmatically?

I have put WebGrid 7 in a User Control .ascx.  Depending on how the User Control Properties are set, I want to set the WebGridColumn Properties DefaultValue and EditType.

I have the WebGrid User Control  in a GridView Template Column and set the UserControl Properties in the GridView Server Side Event RowDataBound.

The GridView.DataBind causes the WebGrid Side Event InitializeLayout to fire before the GridView Server Side Event RowDataBound which means the User Control Properties have not been set yet.  A lot of this probably has to do with Catch-Up Events as documented in here:

http://msdn.microsoft.com/en-us/library/ms178472.aspx#catch_up_events_for_added_controls

I have tried set the WebGridColumn Properties in the WebGrid Server Side Events PreRender and PrepareDataBinding but it does not help.

Due to other issues discussed in this forum previously, I am already doing a WebGrid RebindDataSource in the User Control's Page_PreRender.

Is there a way to invoke the Serve Side Event InitializeLayout programmatically after the I know the User Control Properties have been set?

Or is there somewhere else I can set the WebGridColumn Properties Dynamically?

Thanks,

Doug

All times are GMT -5. The time now is 10:13 AM.
Previous Next