﻿<?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 - WebDesktop - WebFlyPostBackManager and Column heading background in WebGrid</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/WebFlyPostBackManager-and-Column-heading-background-in-WebGrid/</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>WebFlyPostBackManager and Column heading background in WebGrid</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/WebFlyPostBackManager-and-Column-heading-background-in-WebGrid/</link><pubDate>Fri, 31 Oct 2014 02:30:02 GMT</pubDate><dc:creator>Hans</dc:creator><description>&lt;p&gt;Hello,&lt;br&gt;&lt;br&gt;Thank you for the confirmation.&lt;br&gt;&lt;br&gt;I’m glad to hear that the solution works fine on your end.&lt;br&gt;&lt;br&gt;Should you have further question, please do not hesitate to contact us.&lt;br&gt;&lt;br&gt;Regards,&lt;br&gt;Hans K.&lt;br&gt;&lt;/p&gt;</description></item><item><title>WebFlyPostBackManager and Column heading background in WebGrid</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/WebFlyPostBackManager-and-Column-heading-background-in-WebGrid/</link><pubDate>Thu, 30 Oct 2014 10:30:47 GMT</pubDate><dc:creator>devashish</dc:creator><description>&lt;p class="MsoNormal"&gt;Hi Hans,&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Thanks for sample code.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;The solution provided by you works fine.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p&gt;




&lt;/p&gt;&lt;p class="MsoNormal"&gt;Thanks,&lt;br&gt;
Dev&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;</description></item><item><title>WebFlyPostBackManager and Column heading background in WebGrid</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/WebFlyPostBackManager-and-Column-heading-background-in-WebGrid/</link><pubDate>Thu, 30 Oct 2014 06:39:14 GMT</pubDate><dc:creator>Hans</dc:creator><description>&lt;p&gt;Hello,&lt;br&gt;&lt;br&gt;The “Reset” event will cause the WebGrid will do postback event. It won’t call “OnColumnChanged” client side event.&lt;br&gt;&lt;br&gt;So I modified the attached WebGrid page, by adding “OnInitializeLayout” server side event to the WebGrid.&lt;br&gt;In “OnInitializeLayout” event, I add a line of code to modify “Phone” column header color to “Red”.&lt;br&gt;Here’s the snippet code:&lt;br&gt;&lt;/p&gt;&lt;pre&gt;protected void WebGrid1_InitializeLayout(object sender, ISNet.WebUI.WebGrid.LayoutEventArgs e){
    WebGrid1.RootTable.Columns.GetNamedItem("Phone").HeaderStyle.BackColor = System.Drawing.Color.Red;
}&lt;/pre&gt;&lt;p&gt;I attached the modified page as well. Please let me know your response.&lt;br&gt;&lt;br&gt;Regards,&lt;br&gt;Hans K.&lt;br&gt;&lt;/p&gt;</description></item><item><title>WebFlyPostBackManager and Column heading background in WebGrid</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/WebFlyPostBackManager-and-Column-heading-background-in-WebGrid/</link><pubDate>Wed, 29 Oct 2014 14:58:07 GMT</pubDate><dc:creator>devashish</dc:creator><description>&lt;p class="MsoNormal"&gt;Hi Hans,&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Thanks for the workaround. It solved my problem.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;But this is not working if I use the “Reset” option in thecontext menu.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;On grid initiation I am setting the background colour for
the Header now if the user removes the column and add it back the colour should
come back as well.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Using the “OnColumnChanged” event I am able to handle the “Apply”
click but I am not getting any event for “Reset” click.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Please suggest a solution.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p&gt;











&lt;/p&gt;&lt;p class="MsoNormal"&gt;Regards&lt;br&gt;
Dev&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;</description></item><item><title>WebFlyPostBackManager and Column heading background in WebGrid</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/WebFlyPostBackManager-and-Column-heading-background-in-WebGrid/</link><pubDate>Wed, 29 Oct 2014 07:51:55 GMT</pubDate><dc:creator>Hans</dc:creator><description>&lt;p&gt;Hello,&lt;br&gt;&lt;br&gt;Thank you for the reply.&lt;br&gt;&lt;br&gt;I tried to modify your code so that it can resolve your issue. I add setTimeout() method to your code. Here’s the how I add the setTimeout() method:&lt;br&gt;&lt;/p&gt;&lt;pre&gt;function WebGrid1_OnColumnChanged(controlId, tblName, colName, action){
    if (action == "Added")
    {
        if (ISGetObject(controlId).RootTable.GetColumn(colName).AllowGrouping == "Yes")
        {
            window.setTimeout(function ()
            {
                ISGetObject(controlId).RootTable.GetColumn(colName).GetElement().style.backgroundColor = "Red";
            }, 100);
        }
    }
}&lt;/pre&gt;&lt;p&gt;Please kindly have review on the attached page &amp;amp; video about the result of this workaround.&lt;br&gt;&lt;br&gt;Hope this helps.&lt;br&gt;&lt;br&gt;Regards,&lt;br&gt;Hans K.&lt;br&gt;&lt;/p&gt;</description></item><item><title>WebFlyPostBackManager and Column heading background in WebGrid</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/WebFlyPostBackManager-and-Column-heading-background-in-WebGrid/</link><pubDate>Tue, 28 Oct 2014 14:30:24 GMT</pubDate><dc:creator>devashish</dc:creator><description>&lt;p style="margin: 0in 0in 15pt;"&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>WebFlyPostBackManager and Column heading background in WebGrid</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/WebFlyPostBackManager-and-Column-heading-background-in-WebGrid/</link><pubDate>Tue, 28 Oct 2014 14:30:22 GMT</pubDate><dc:creator>devashish</dc:creator><description>&lt;p style="margin: 0in 0in 15pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Sans Unicode', sans-serif;"&gt;Hi Hans,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0in 0in 15pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Sans Unicode', sans-serif;"&gt;Thanks for&amp;nbsp;your reply.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0in 0in 15pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Sans Unicode', sans-serif;"&gt;I am trying to add the background colour to the header when column is added from the context menu.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0in 0in 15pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Sans Unicode', sans-serif;"&gt;I tried to add the code provided by you as shown below, &amp;nbsp;but its throwing JavaScript error “Unable to get property 'style’ of undefined ornull reference”.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;table class="MsoTableGrid" border="1" cellspacing="0" cellpadding="0" style="border-collapse:collapse;border:none;mso-border-alt:solid windowtext .5pt; mso-yfti-tbllook:1184;mso-padding-alt:0in 5.4pt 0in 5.4pt"&gt;
 &lt;tbody&gt;&lt;tr style="mso-yfti-irow:0;mso-yfti-firstrow:yes;mso-yfti-lastrow:yes;
  height:121.9pt"&gt;
  &lt;td width="616" valign="top" style="width: 462.1pt; border: 1pt solid windowtext; padding: 0in 5.4pt; height: 121.9pt;"&gt;
  &lt;p class="MsoNormal" style="margin: 12pt 0in 0.0001pt;"&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;
  color:blue;background:white;mso-highlight:white"&gt;function&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background: white;"&gt; OnColumnChanged(controlId, tblName, colName, action){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.5in;"&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;
  mso-highlight:white"&gt;if&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background: white;"&gt;(action == &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:#A31515;background:white;
  mso-highlight:white"&gt;"Added"&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background: white;"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in; text-indent: 0.5in;"&gt;&lt;span style="font-size:9.5pt;
  font-family:Consolas;color:blue;background:white;mso-highlight:white"&gt;if&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background: white;"&gt;(ISGetObject(controlId).RootTable.GetColumn(colName).AllowGrouping
  == &lt;/span&gt;&lt;span style="font-size:9.5pt;font-family:Consolas;color:#A31515;
  background:white;mso-highlight:white"&gt;"Yes"&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background: white;"&gt;) {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;p class="MsoNormal" style="margin: 0in 0in 0.0001pt 1in; text-indent: 0.5in;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background: white;"&gt;ISGetObject(controlId).RootTable.GetColumn(colName).
  GetElement().style.backgroundColor = &lt;/span&gt;&lt;span style="font-size:9.5pt;
  font-family:Consolas;color:#A31515;background:white;mso-highlight:white"&gt;"Red"&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background: white;"&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;p style="margin: 0in 0in 15pt; text-indent: 0.5in;"&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas; background: white;"&gt;}&lt;/span&gt;&lt;span style="font-size: 9.5pt; font-family: Consolas;"&gt;&lt;br&gt;
  }&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Sans Unicode', sans-serif;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin: 0in 0in 15pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Sans Unicode', sans-serif;"&gt;Can you please tell what’s wrong with this implementation and a way to achieve the given scenario? &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0in 0in 15pt;"&gt;











&lt;/p&gt;&lt;p style="margin: 0in 0in 15pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Sans Unicode', sans-serif;"&gt;Regards&lt;br&gt;
Dev&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;</description></item><item><title>WebFlyPostBackManager and Column heading background in WebGrid</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/WebFlyPostBackManager-and-Column-heading-background-in-WebGrid/</link><pubDate>Tue, 28 Oct 2014 14:30:20 GMT</pubDate><dc:creator>devashish</dc:creator><description>&lt;p style="margin: 0in 0in 15pt;"&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>WebFlyPostBackManager and Column heading background in WebGrid</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/WebFlyPostBackManager-and-Column-heading-background-in-WebGrid/</link><pubDate>Tue, 28 Oct 2014 08:59:27 GMT</pubDate><dc:creator>Hans</dc:creator><description>&lt;p&gt;Hello,&lt;br&gt;&lt;br&gt;I created a WebGrid page, I bound the WebGrid to access data source (Northwind.mdb database &amp;amp; Shippers table).&lt;br&gt;I added a HTML input button to the page and created a JavaScript code to modify the Phone column color into red.&lt;br&gt;&lt;br&gt;Here’s the example snippet code to modify column’s color:&lt;/p&gt;&lt;pre&gt;function SetColor(){
    var WebGrid1 = ISGetObject("WebGrid1");
    WebGrid1.RootTable.Columns[2].GetElement().style.backgroundColor = "Red";
}&lt;/pre&gt;&lt;p&gt;I attached the WebGrid page, so that you could see the result furthermore.&lt;br&gt;&lt;br&gt;Hope this helps.&lt;br&gt;&lt;br&gt;Regards,&lt;br&gt;Hans K.&lt;br&gt;&lt;/p&gt;</description></item><item><title>WebFlyPostBackManager and Column heading background in WebGrid</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/WebFlyPostBackManager-and-Column-heading-background-in-WebGrid/</link><pubDate>Mon, 27 Oct 2014 15:21:00 GMT</pubDate><dc:creator>devashish</dc:creator><description>&lt;p&gt;Hi Glenn,&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: 'Lucida Sans Unicode', sans-serif;"&gt;Is there any way to achieve this in JavaScript?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: 'Lucida Sans Unicode', sans-serif;"&gt;Regards&lt;/span&gt;&lt;/p&gt;</description></item><item><title>WebFlyPostBackManager and Column heading background in WebGrid</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/WebFlyPostBackManager-and-Column-heading-background-in-WebGrid/</link><pubDate>Wed, 04 Nov 2009 09:52:29 GMT</pubDate><dc:creator>tj@domesticsoft.com</dc:creator><description>&lt;p&gt;For further information refere to never solved case &lt;span style="font-size: 9px"&gt;IS-5104B939-47A2-40CE-A43D-4A8D67C8B76D &lt;/span&gt;from early this year.&lt;/p&gt;
&lt;p&gt;I have a page with a WebGrid and FlyPostBack Manager with &lt;span style="color: #ff0000; font-size: 13px"&gt;&lt;span style="color: #ff0000; font-size: 13px"&gt;EnableUIMode&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #0000ff; font-size: 13px"&gt;&lt;span style="color: #0000ff; font-size: 13px"&gt;="True". &lt;span style="color: #000000"&gt;The web grid is created dynamicaly on each request, so the number of column is dynamic. I have to color the column headings. Let us say in the first request there are 4 columns with those column headings:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Col1 = Blue&lt;br /&gt;Col2 = Red&lt;br /&gt;Col3 = Yellow&lt;br /&gt;Col4 = default color (no color set)&lt;/p&gt;
&lt;p&gt;In the second request let us say the columns are only 3 setup in code behind with those colors: &lt;/p&gt;
&lt;p&gt;Col1 = Blue&lt;br /&gt;Col2 = Red&lt;br /&gt;Col3 = default color (no color set)&lt;/p&gt;
&lt;p&gt;Unfortunately Col3 now shows up with yellow color (from the first request). To solve this problem I tried something like this as I expected this is happening because the layout of the grid is not posted back to the client (because of the WebFlyPostBack Manager):&lt;/p&gt;
&lt;p&gt;//Flypostback event server side&lt;/p&gt;
&lt;p&gt;WebFlyPostBackManager1.ClientAction.InvokeScript("SetDefaultStyle()");&lt;/p&gt;
&lt;p&gt;//Client side event&lt;/p&gt;
&lt;p&gt;function SetDefaultStyle()&lt;br /&gt;{&lt;br /&gt;var WebGrid1 = ISGetObject("WebGrid1");&lt;br /&gt;WebGrid1.RootTable.Columns[2].GetElement().style.backgroundColor = "#D4DDEA";&lt;br /&gt;WebGrid1.RootTable.Columns[2].GetElement().style.backgroundImage = "url(ISRes.axd?G/wg5_bk_pro.gif)";&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;However that does not help.&lt;/p&gt;
&lt;p&gt;Im using 2008 R1 and the webgrid is using "Elegant style".&lt;br /&gt;&lt;br /&gt;How can I solve this issue?&lt;/p&gt;</description></item></channel></rss>