﻿<?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 to migrate  the codes to the appropriate client-side events.</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-migrate-the-codes-to-the-appropriate-client-side-events/</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 to migrate  the codes to the appropriate client-side events.</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-migrate-the-codes-to-the-appropriate-client-side-events/</link><pubDate>Sun, 12 Nov 2017 12:01:22 GMT</pubDate><dc:creator>rogerchen.tangshuo@gmail.com</dc:creator><description>&lt;p&gt;in WebGrid&amp;nbsp;Client-side binding mode，how to&amp;nbsp;migrate&amp;nbsp; the codes to the appropriate client-side events.&lt;/p&gt;&lt;p&gt;&lt;span style="background-color: rgb(255, 252, 225); font-family: &amp;quot;Courier New&amp;quot;, Tahoma; font-size: 9pt;"&gt;protected void wg_test_InitializeRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e)&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;        {
            if (e.Row.Table.DataMember == "TMyTable")
            {
                if (e.Row.Type == RowType.Record)
                {
                    DataRowView objRow = (DataRowView)e.Row.DataRow;
                    // obtain the cells collection of the current row 
                    WebGridCellCollection cells = e.Row.Cells;

                    WebGridCellTemplateContainer detail_cell = cells.GetNamedItem("f_id").GetTemplateContainer();
                    LinkButton lb_detail = (LinkButton)detail_cell.FindControl("lb_detail");
                    lb_detail.Attributes["OnClick"] = "return showToolTip(this, '" + objRow["f_id"].ToString() + "')";

                    e.Row.Style.Font.Bold = true;

                    if (objRow["f_step"].ToString() == "2")                 
                        e.Row.Style.ForeColor = System.Drawing.Color.Green;
                    else if (objRow["f_step"].ToString() == "1")            
                        e.Row.Style.ForeColor = System.Drawing.Color.Blue;
                    else if (objRow["f_step"].ToString() == "-2")          
                        e.Row.Style.ForeColor = System.Drawing.Color.Black;
                    else if (objRow["f_step"].ToString() == "0")                                   &lt;/pre&gt;&lt;pre&gt;                      e.Row.Style.ForeColor = System.Drawing.Color.CadetBlue;
                }
            }
        }&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;pre&gt;        function InitializeRow(id, row) {
            if (row.Type == "Record") {

	    // DataRowView objRow = (DataRowView)e.Row.DataRow; 
            // WebGridCellCollection cells = e.Row.Cells;

	    // WebGridCellTemplateContainer detail_cell = cells.GetNamedItem("f_id").GetTemplateContainer();
            // LinkButton lb_detail = (LinkButton)detail_cell.FindControl("lb_detail");
            // lb_detail.Attributes["OnClick"] = "return showToolTip(this, '" + objRow["f_id"].ToString() + "')";

	    //e.Row.Style.Font.Bold = true;

            //if (objRow["f_step"].ToString() == "2")                 
            //    e.Row.Style.ForeColor = System.Drawing.Color.Green;
            //else if (objRow["f_step"].ToString() == "1")            
            //    e.Row.Style.ForeColor = System.Drawing.Color.Blue;
            //else if (objRow["f_step"].ToString() == "-2")          
            //    e.Row.Style.ForeColor = System.Drawing.Color.Black;
            //else if (objRow["f_step"].ToString() == "0")           
            //    e.Row.Style.ForeColor = System.Drawing.Color.CadetBlue;

            }
        }&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;thanks&lt;/p&gt;</description></item></channel></rss>