﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - WebGrid Enterprise - How can I invoke Server Side Event InitializeLayout programmatically?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-can-I-invoke-Server-Side-Event-InitializeLayout-programmatically/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>How can I invoke Server Side Event InitializeLayout programmatically?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-can-I-invoke-Server-Side-Event-InitializeLayout-programmatically/</link><pubDate>Tue, 27 Apr 2010 11:55:53 GMT</pubDate><dc:creator>Glayaar</dc:creator><description>&lt;p&gt;Glad to hear that the issue has been solved.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>How can I invoke Server Side Event InitializeLayout programmatically?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-can-I-invoke-Server-Side-Event-InitializeLayout-programmatically/</link><pubDate>Mon, 26 Apr 2010 19:42:30 GMT</pubDate><dc:creator>DJBadin</dc:creator><description>&lt;p&gt;Setting the WebGridColumn.DefaultValue worked in OnAfterInitialize &lt;/p&gt;
&lt;p&gt;I was finally able to call the WebGridCell.SetForceNoEdit Method in OnAfterInitialize but it didn't stick.&lt;/p&gt;
&lt;p&gt;I found this post and was able to get SetForceNoEdit to work in the SetForceNoEdit OnRowSelect.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.intersoftpt.com/Community/WebGrid/Tab-ForceNoEdit/"&gt;http://www.intersoftpt.com/Community/WebGrid/Tab-ForceNoEdit/&lt;/a&gt;&lt;/p&gt;</description></item><item><title>How can I invoke Server Side Event InitializeLayout programmatically?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-can-I-invoke-Server-Side-Event-InitializeLayout-programmatically/</link><pubDate>Mon, 26 Apr 2010 13:17:57 GMT</pubDate><dc:creator>Glayaar</dc:creator><description>&lt;p&gt;The issue has been discussed further in Live Chat. Since the goal is to modify the ability to enable or disable edit of a row or cell, using client side event handler OnAfterInitialize is possible to achieve such feature.&lt;/p&gt;&lt;p&gt;The client side function to disable edit is &lt;em&gt;SetForceNoEdit(true)&lt;/em&gt;, which could be applied to WebGrid cell object or WebGrid row object. Here is the snippet to disable first row in WebGrid and column Author in second row of WebGrid:&lt;/p&gt;&lt;pre&gt;grid.RootTable.GetRow(0).SetForceNoEdit(true);&lt;br /&gt;&lt;br /&gt;grid.RootTable.GetRow(1).GetCell('Author').SetForceNoEdit(true);&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>How can I invoke Server Side Event InitializeLayout programmatically?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-can-I-invoke-Server-Side-Event-InitializeLayout-programmatically/</link><pubDate>Mon, 26 Apr 2010 07:43:05 GMT</pubDate><dc:creator>DJBadin</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;That does not cause the &lt;span style="font-family: calibri; font-size: 15px"&gt;InitializeLayout or PrepareDataBinding to fire again.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: calibri; font-size: 15px"&gt;Like I said before, I was already doing a RebindDataSource in the User Control's Page_PreRender.&amp;nbsp; Doing ClearCachedDataSource() before RebindDataSource did not help.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: calibri; font-size: 15px"&gt;Any other thoughts?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: calibri; font-size: 15px"&gt;Thanks,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: calibri; font-size: 15px"&gt;Doug&lt;/span&gt;&lt;/p&gt;</description></item><item><title>How can I invoke Server Side Event InitializeLayout programmatically?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-can-I-invoke-Server-Side-Event-InitializeLayout-programmatically/</link><pubDate>Mon, 26 Apr 2010 00:39:28 GMT</pubDate><dc:creator>andi@intersoftpt.com</dc:creator><description>&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Hi Douglas Badin,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; Usually, we can only set the WebGrid column property dynamically in server side event of PrepareDataBinding and InitializeLayout. In your case, could you kindly try to use these block of code.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;&lt;span style="font-size: 9pt; "&gt;        WebGrid1.ClearCachedDataSource();
        WebGrid1.RebindDataSource();&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;These code, ClearCachedDataSource and RebindDataSource, are used to clear&amp;nbsp;cached data 
source and rebind the datasource. That is why, it is also can help us to re-triggered the server side InitializeLayout event.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; I hope it helps. Thank you and have a nice day.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Best Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Andi Santoso&lt;/span&gt;&lt;/p&gt;
&lt;p /&gt;</description></item><item><title>How can I invoke Server Side Event InitializeLayout programmatically?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-can-I-invoke-Server-Side-Event-InitializeLayout-programmatically/</link><pubDate>Sun, 25 Apr 2010 14:31:32 GMT</pubDate><dc:creator>DJBadin</dc:creator><description>&lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family: calibri; font-size: 15px"&gt;How can I invoke the Serve Side Event InitializeLayout programmatically?&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family: calibri; font-size: 15px"&gt;I have put WebGrid 7 in a User Control .ascx.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;Depending on how the User Control Properties are set, I want to set the WebGridColumn Properties DefaultValue and EditType.&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family: calibri; font-size: 15px"&gt;I have the WebGrid User Control&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;in a GridView Template Column and set the UserControl Properties in the GridView Server Side Event RowDataBound.&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family: calibri; font-size: 15px"&gt;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. &lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;A lot of this probably has to do with Catch-Up Events as documented in here:&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family: calibri; font-size: 15px"&gt;http://msdn.microsoft.com/en-us/library/ms178472.aspx#catch_up_events_for_added_controls&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family: calibri; font-size: 15px"&gt;I have tried set the WebGridColumn Properties in the WebGrid Server Side Events PreRender and PrepareDataBinding but it does not help.&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family: calibri; font-size: 15px"&gt;Due to other issues discussed in this forum previously, I am already doing a WebGrid RebindDataSource in the User Control's Page_PreRender.&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family: calibri; font-size: 15px"&gt;Is there a way to invoke the Serve Side Event InitializeLayout programmatically after the I know the User Control Properties have been set?&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family: calibri; font-size: 15px"&gt;Or is there somewhere else I can set the WebGridColumn Properties Dynamically?&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family: calibri; font-size: 15px"&gt;Thanks,&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;&lt;span style="font-family: calibri; font-size: 15px"&gt;Doug&lt;/span&gt;&lt;/p&gt;
</description></item></channel></rss>