<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Dynamically setting column names on an editable grid (Babar Ismail)</title><link>http://blogs.msdn.com/b/lightswitch/archive/2012/07/24/dynamically-setting-column-names-on-an-editable-grid-babar-ismail.aspx</link><description>LightSwitch gives us the ability to import data from numerous sources. This data can then be shown to the end user in an editable grid by simply creating editable grid screens based off that data. The column names of the grid will correspond to the field</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Dynamically setting column names on an editable grid (Babar Ismail)</title><link>http://blogs.msdn.com/b/lightswitch/archive/2012/07/24/dynamically-setting-column-names-on-an-editable-grid-babar-ismail.aspx#10340750</link><pubDate>Thu, 16 Aug 2012 23:20:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10340750</guid><dc:creator>M.Radwan-MVP</dc:creator><description>&lt;p&gt;This was really awesome... thank you :)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10340750" width="1" height="1"&gt;</description></item><item><title>re: Dynamically setting column names on an editable grid (Babar Ismail)</title><link>http://blogs.msdn.com/b/lightswitch/archive/2012/07/24/dynamically-setting-column-names-on-an-editable-grid-babar-ismail.aspx#10334001</link><pubDate>Fri, 27 Jul 2012 03:13:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10334001</guid><dc:creator>Yann Duran</dc:creator><description>&lt;p&gt;Thanks Babar!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10334001" width="1" height="1"&gt;</description></item><item><title>re: Dynamically setting column names on an editable grid (Babar Ismail)</title><link>http://blogs.msdn.com/b/lightswitch/archive/2012/07/24/dynamically-setting-column-names-on-an-editable-grid-babar-ismail.aspx#10333862</link><pubDate>Thu, 26 Jul 2012 19:11:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10333862</guid><dc:creator>LightSwitch Team</dc:creator><description>&lt;p&gt;Thanks Yann for your comment.. The intention of this post was to explain how we can achieve a certain functionality in LightSwitch. I used this example to simplify things and not to suggest it is ok to design databases like that. But I understand where you&amp;#39;re coming from and is definitely something to keep in mind.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Babar&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10333862" width="1" height="1"&gt;</description></item><item><title>re: Dynamically setting column names on an editable grid (Babar Ismail)</title><link>http://blogs.msdn.com/b/lightswitch/archive/2012/07/24/dynamically-setting-column-names-on-an-editable-grid-babar-ismail.aspx#10333859</link><pubDate>Thu, 26 Jul 2012 19:06:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10333859</guid><dc:creator>Babloo1436</dc:creator><description>&lt;p&gt;@Babar&lt;/p&gt;
&lt;p&gt;I really appreciate that you updated the code sample. &lt;/p&gt;
&lt;p&gt;Yes. The Updated code is working fine. And ofcource this is really a very useful post.&lt;/p&gt;
&lt;p&gt;Thank You Babar&lt;/p&gt;
&lt;p&gt;Thanks LightSwitch Team&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10333859" width="1" height="1"&gt;</description></item><item><title>re: Dynamically setting column names on an editable grid (Babar Ismail)</title><link>http://blogs.msdn.com/b/lightswitch/archive/2012/07/24/dynamically-setting-column-names-on-an-editable-grid-babar-ismail.aspx#10333706</link><pubDate>Thu, 26 Jul 2012 10:53:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10333706</guid><dc:creator>Yann Duran</dc:creator><description>&lt;p&gt;Hi Babar,&lt;/p&gt;
&lt;p&gt;Thanks for the blog post, but I really wish that such explanations were based on something a little more &amp;quot;real world&amp;quot; than a table with properties like Car1, Car2, Car3 etc. That&amp;#39;s an example of an really badly designed table. If someone who&amp;#39;s new to programming sees properties like this in an example, they&amp;#39;re likely to think it&amp;#39;s ok to create their tables the same way, because they see a member of the LS team doing it.&lt;/p&gt;
&lt;p&gt;I spent years trying to &amp;quot;fix&amp;quot; tables like that in Access for clients, because the people who created them didn&amp;#39;t know any better.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m also glad to see that you ammended your code to not be trying to access a control before the screen has been &amp;quot;created&amp;quot;. Yes, you may get away with it some of the time (or even most of the time), but it&amp;#39;s the times when it doesn&amp;#39;t work that will have people baffled.&lt;/p&gt;
&lt;p&gt;This article would be much more useful if it described a &amp;quot;real&amp;quot; scenario, with well-designed tables.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m sorry if I sound negative, I do appreciate members of the team taking the time to write these posts, but I also hope you understand what I&amp;#39;m getting at.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10333706" width="1" height="1"&gt;</description></item><item><title>re: Dynamically setting column names on an editable grid (Babar Ismail)</title><link>http://blogs.msdn.com/b/lightswitch/archive/2012/07/24/dynamically-setting-column-names-on-an-editable-grid-babar-ismail.aspx#10333579</link><pubDate>Thu, 26 Jul 2012 00:53:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10333579</guid><dc:creator>LightSwitch Team</dc:creator><description>&lt;p&gt;i have updated the blog post with new code. Our findcontrol method is now being called in Screen_Created method and UpdateColumnNames also has a little different implementation.&lt;/p&gt;
&lt;p&gt;Babloo... let me know if the new code works for you.&lt;/p&gt;
&lt;p&gt;Mr Yossu.. I have also moved the call to UpdateColumnNames method into the ControlAvailable event handler. Hope this solves the problem.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br /&gt;Babar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10333579" width="1" height="1"&gt;</description></item><item><title>re: Dynamically setting column names on an editable grid (Babar Ismail)</title><link>http://blogs.msdn.com/b/lightswitch/archive/2012/07/24/dynamically-setting-column-names-on-an-editable-grid-babar-ismail.aspx#10333438</link><pubDate>Wed, 25 Jul 2012 18:13:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10333438</guid><dc:creator>LightSwitch Team</dc:creator><description>&lt;p&gt;I haven&amp;#39;t encountered this issue in V2 so far although I have used code quite similar to this extensively in an app I have been working on. &lt;/p&gt;
&lt;p&gt;If you are encountering such issues then you can move it Screen_Created() method.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Babar&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10333438" width="1" height="1"&gt;</description></item><item><title>re: Dynamically setting column names on an editable grid (Babar Ismail)</title><link>http://blogs.msdn.com/b/lightswitch/archive/2012/07/24/dynamically-setting-column-names-on-an-editable-grid-babar-ismail.aspx#10333360</link><pubDate>Wed, 25 Jul 2012 16:08:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10333360</guid><dc:creator>Babloo1436</dc:creator><description>&lt;p&gt;@Yossu&lt;/p&gt;
&lt;p&gt;Thank you for your answer.&lt;/p&gt;
&lt;p&gt;It helps me to understand correctly.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10333360" width="1" height="1"&gt;</description></item><item><title>re: Dynamically setting column names on an editable grid (Babar Ismail)</title><link>http://blogs.msdn.com/b/lightswitch/archive/2012/07/24/dynamically-setting-column-names-on-an-editable-grid-babar-ismail.aspx#10333302</link><pubDate>Wed, 25 Jul 2012 13:04:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10333302</guid><dc:creator>Mr Yossu</dc:creator><description>&lt;p&gt;In the CarRatingsGridScreen_InitializeDataWorkspace method, you use FindControl to subscribe to the ControlAvailable event, and then immediately call UpdateColumnNames() from the same method.&lt;/p&gt;
&lt;p&gt;If the grid isn&amp;#39;t available when the CarRatingsGridScreen_InitializeDataWorkspace method fires (which is quite possible), then you&amp;#39;ll get the InvalidOperationException thrown.&lt;/p&gt;
&lt;p&gt;Surely you should call UpdateColumnNames from CarRatingsGrid_ControlAvailable, because then you know the grid will be available (that&amp;#39;s the point of the method after all). That way you&amp;#39;re pretty much guaranteed not to get the exception.&lt;/p&gt;
&lt;p&gt;Don&amp;#39;t know if this helps you Babloo1436?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10333302" width="1" height="1"&gt;</description></item><item><title>re: Dynamically setting column names on an editable grid (Babar Ismail)</title><link>http://blogs.msdn.com/b/lightswitch/archive/2012/07/24/dynamically-setting-column-names-on-an-editable-grid-babar-ismail.aspx#10333199</link><pubDate>Wed, 25 Jul 2012 03:56:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10333199</guid><dc:creator>thang</dc:creator><description>&lt;p&gt;thanks !!!&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://www.blogomegamartvn.blogspot.com"&gt;www.blogomegamartvn.blogspot.com&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://www.omegamart.vn"&gt;http://www.omegamart.vn&lt;/a&gt;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10333199" width="1" height="1"&gt;</description></item></channel></rss>