﻿<?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 - background color change</title><link>http://www.intersoftsolutions.com/Community/WebGrid/background-color-change/</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>background color change</title><link>http://www.intersoftsolutions.com/Community/WebGrid/background-color-change/</link><pubDate>Tue, 20 Jul 2010 03:28:49 GMT</pubDate><dc:creator>ismail</dc:creator><description>&lt;p&gt;thank you so much. it solved my problem&lt;/p&gt;</description></item><item><title>background color change</title><link>http://www.intersoftsolutions.com/Community/WebGrid/background-color-change/</link><pubDate>Mon, 19 Jul 2010 10:19:22 GMT</pubDate><dc:creator>andi@intersoftpt.com</dc:creator><description>&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Hi Ca,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Yes, if we are using a grouped WebGrid, the group header will be counted as a Row. That is why, using that approach will give us an ugly result. In your case, I think we will need to use GetSelectedObject, instead of getting its row by GetRow. Here is the snippet:&lt;/span&gt;&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;&lt;span style="font-size: 9pt; "&gt;        function WebGrid1_OnCellClick(controlId, tblName, rowIndex, cellIndex, cellEl) {
            var indexNumber;

            var WebGrid1 = ISGetObject(controlId);
            var rootTable = WebGrid1.RootTable;
            var columnLength = rootTable.Columns.length;
            
            if (rootTable.GroupedColumns.length &amp;gt; 0)
                indexNumber = 2;
            else
                indexNumber = 1;

            setTimeout(function () {
                var getObject = WebGrid1.GetSelectedObject().ToRowObject();
                if (getObject.Type != "GroupHeader") {

                    for (var i = indexNumber; i &amp;lt;= columnLength; i&amp;#43;&amp;#43;) {

                        getObject.RowElement.cells[i].style.setAttribute("backgroundColor", "Red", true);
                    }
                }
            }, 500);
            return true;
        }&lt;/span&gt;&lt;/pre&gt;
&lt;p /&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; I hope it can help solve your issue. 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;</description></item><item><title>background color change</title><link>http://www.intersoftsolutions.com/Community/WebGrid/background-color-change/</link><pubDate>Sun, 18 Jul 2010 04:48:18 GMT</pubDate><dc:creator>ismail</dc:creator><description>&lt;p&gt;hi,&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;did you check it with grouped grid. &lt;/p&gt;
&lt;p&gt;I am getting incorrect answer, because my grid is grouped by date field. the row count is not coming correctly .&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;i also tried the &lt;/p&gt;&lt;pre&gt;             var grid = ISGetObject("WebGrid1");             
             var selectedObject = grid.GetSelectedObject();              
                          
             if (selectedObject != null)
             {                		
                
                var selectedRow = selectedObject.ToRowObject(); 
                var pos= selectedRow.Position ;
                alert(pos);
                var rowEl = grid.RootTable.GetRow(pos).RowElement;
                 for (var i = 1; i &amp;lt; rowEl.cells.length; i&amp;#43;&amp;#43;) {

                    alert(rowEl.cells[3].style.backgroundColor)
                  }
              }&lt;/pre&gt;
&lt;p&gt;but here i am getting incorrect row position. so incorrect background&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;please help me.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;thanks and regards&lt;/p&gt;
&lt;p&gt;ca&lt;/p&gt;</description></item><item><title>background color change</title><link>http://www.intersoftsolutions.com/Community/WebGrid/background-color-change/</link><pubDate>Wed, 14 Jul 2010 12:53:21 GMT</pubDate><dc:creator>andi@intersoftpt.com</dc:creator><description>&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Hi Ca,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; In your case, I would say that it would be better if we use OnCellClick client side event. With this event, it will make us easier to create a validation for the hyperlinked column.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; At this moment, our WebGrid cannot change the background color for any particular row. However, what we can do is to change the color of cell by cell. Here is the snippet to do so:&lt;/span&gt;&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;&lt;span style="font-size: 9pt; "&gt;   &amp;lt;script language="javascript" type="text/javascript" id="WebGrid1_OnCellClick"&amp;gt;
		&amp;lt;!--
        function WebGrid1_OnCellClick(controlId, tblName, rowIndex, cellIndex, cellEl) {
            var WebGrid1 = ISGetObject(controlId);

            var rowEl = WebGrid1.RootTable.GetRow(rowIndex).RowElement;

            for (var i = 1; i &amp;lt; rowEl.cells.length; i&amp;#43;&amp;#43;) {

                rowEl.cells[i].style.setAttribute("backgroundColor", "Red", true);
            }

            return true;
        }
		--&amp;gt;
    &amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/pre&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;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;</description></item><item><title>background color change</title><link>http://www.intersoftsolutions.com/Community/WebGrid/background-color-change/</link><pubDate>Wed, 14 Jul 2010 02:36:10 GMT</pubDate><dc:creator>ismail</dc:creator><description>hi,
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;please help me to solve the issue.&lt;/p&gt;
&lt;p&gt;i have one grid , in which one column contains hyperlink. Here i want to change the background color of the row, once user click on the link cell. &lt;br /&gt;&lt;/p&gt;
&lt;p&gt;i tried with both OnCellClick and OnRowSelect events.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;OnCellClick: Here i first check whether the clicked column is hyperlinked column.&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;But the probelm is here i cannot able to change the background color of the full row.&lt;/p&gt;
&lt;p&gt;is there any way to change the background color of the full row in OnCellClick event. &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;OnRowSelect: here i am not able to find out , whether the clicked column is the desired hyperlink column. is there any way to find out which column i clicked in this event.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Also let me know is it able to get and set the Background and Background2 in these two events &lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>