﻿<?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 - Setting A Tooltip For A Specific Cell Using Conditional Formatting</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Setting-A-Tooltip-For-A-Specific-Cell-With-Conditional-Formatting/</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>Setting A Tooltip For A Specific Cell Using Conditional Formatting</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Setting-A-Tooltip-For-A-Specific-Cell-With-Conditional-Formatting/</link><pubDate>Mon, 07 Mar 2011 03:48:38 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;We have a sample that shows how to integrate WebCallOut into WebGrid. You can check the live sample at &lt;a href="http://live.intersoftpt.com/cs/WebDesktop/WebCallOut/WebCallOutAndWebGrid.aspx"&gt;http://live.intersoftpt.com/cs/WebDesktop/WebCallOut/WebCallOutAndWebGrid.aspx&lt;/a&gt;. The sample also available in (assumed that you have installed Intersoft WebUI Studio) WebDesktopSamples project. Please point your mouse to start &amp;gt; All Programs &amp;gt; Intersoft WebUI Studio 2010 R2 &amp;gt; WebUI Studio for ASP.NET &amp;gt; WebDesktop 3 &amp;gt; C# Samples (Visual Studio 2010 Solution). The sample file is WebCallOutAndWebGrid.aspx. It is located inside the WebCallOut folder.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;The step-by-step below shows how to integrate WebCallOut into WebGrid.&lt;/span&gt;&lt;/p&gt;
&lt;ol style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;&lt;li&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Drag &lt;strong&gt;WebGrid&lt;/strong&gt; and &lt;strong&gt;WebCallOut&lt;/strong&gt; controls to the WebForm.&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Create a cell template by setting &lt;strong&gt;ColumnType&lt;/strong&gt; to &lt;strong&gt;Template&lt;/strong&gt;.&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Place an ASP.NET Label control and add &lt;strong&gt;OnMouseOver&lt;/strong&gt; like following.&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;pre&gt;&amp;lt;ISWebGrid:WebGridColumn ColumnType="Template" Name="Email" Caption="FirstName" Width="100px"&amp;gt;
    &amp;lt;CellTemplate&amp;gt;
        &amp;lt;asp:Label ID="Label1" runat="server" Text="Label" ToolTip="" OnMouseOver="return ShowWebCallOut(this)"&amp;gt;&amp;lt;/asp:Label&amp;gt;
    &amp;lt;/CellTemplate&amp;gt;
&amp;lt;/ISWebGrid:WebGridColumn&amp;gt;&lt;/pre&gt;
&lt;ol style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt" start="4"&gt;&lt;li&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Now, put the following code in &lt;strong&gt;InitializeRow server-side event&lt;/strong&gt; in order to initialize data when WebGrid first loads.&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;pre&gt;protected void WebGrid1_InitializeRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e)
{
    WebGridRow row = (WebGridRow)e.Row;
    WebGridCellTemplateContainer cell = row.Cells.GetNamedItem("Email").GetTemplateContainer();
    Label lbl = (Label)cell.FindControl("Label1");
    lbl.Text = "" &amp;#43; e.Row.Cells.GetNamedItem("FirstName").Text; // &amp;#43;"@gmail.com";
}&lt;/pre&gt;
&lt;ol style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt" start="5"&gt;&lt;li&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Create &lt;strong&gt;ShowWebCallOut()&lt;/strong&gt; function in client-side to show WebCallOut in WebGrid.&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;pre&gt;function ShowWebCallOut(WebGridLabel)
{
    var callout = ISGetObject("WebCallOut1");
    var targetId = document.getElementById(WebGridLabel.id);
    var calloutContent = callout.GetContentElement();
            
    var span;
    var text;
            
    if (IS.ie)
    {
        span = calloutContent.childNodes[0].rows[1].cells[0].childNodes[0].rows[0].cells[0].childNodes[0]
        text = calloutContent.childNodes[0].rows[1].cells[0].childNodes[0].rows[0].cells[0].childNodes[2]
    }
    else
    {
        span = calloutContent.childNodes[1].rows[1].cells[0].childNodes[1].rows[0].cells[0].childNodes[1];
        text = calloutContent.childNodes[1].rows[1].cells[0].childNodes[1].rows[0].cells[0].childNodes[3];
    }
            
    span.innerText = WebGridLabel.innerText;
    text.nodeValue = WebGridLabel.innerText &amp;#43; "@gmail.com";
    window.setTimeout(function() {callout.ShowAutoDetect(targetId, true);}, 700); 
}&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Hope this helps.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Setting A Tooltip For A Specific Cell Using Conditional Formatting</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Setting-A-Tooltip-For-A-Specific-Cell-With-Conditional-Formatting/</link><pubDate>Sat, 05 Mar 2011 22:09:18 GMT</pubDate><dc:creator>NK1958</dc:creator><description>&lt;p&gt;Hello InterSoft,&lt;/p&gt;
&lt;p&gt;I would like to set a formatted tooltip that looks like a table using a webcallout object. My grid layout populated dinamically from xml file. I have attached a sample from Niven Prasetya which show how to do it if columns are created in aspx file. How to reproduce it using C# code. Please provide a sample.&lt;/p&gt;&lt;pre&gt;I try to do this but it doesn't work:

foreach (WebGridColumn column in grid.RootTable.Columns)

{

if (column.Name == "TICKER")

column.ColumnType = ColumnType.Template;

}



protected void Grid_InitRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e)

{

if (e.Row.Cells.GetNamedItem("TICKER") != null)

{

WebGridCellTemplateContainer cell = e.Row.Cells.GetNamedItem("TICKER").GetTemplateContainer();

Label lbl = new Label();

lbl.Text = e.Row.Cells.GetNamedItem("TICKER").Text &amp;#43; " Test";

lbl.Attributes.Add("onmouseover", "ShowWebCallOut()");

cell.Controls.Add(lbl);

}
&lt;/pre&gt;
</description></item></channel></rss>