﻿<?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 - A link for group text</title><link>http://www.intersoftsolutions.com/Community/WebGrid/A-link-for-group-text/</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>A link for group text</title><link>http://www.intersoftsolutions.com/Community/WebGrid/A-link-for-group-text/</link><pubDate>Wed, 30 Mar 2011 00:24:47 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;Hello Frank,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;I’m testing this scenario using &lt;strong&gt;WebGrid 7.0 build 429 and WebUI.NET Framework 3.0 build 770&lt;/strong&gt;. In my test page, I need to do step #1 – &lt;em&gt;set &lt;strong&gt;ColumnType&lt;/strong&gt; property to &lt;strong&gt;“Custom”&lt;/strong&gt;&lt;/em&gt;, because by default the ColumnType property is set to “Text”. If the ColumnType is “Text”, the hyperlink tag in the group header will be treated as literal text.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;ColumnType=”Text” means that cells that belong to a column with this setting will display only text.&lt;/span&gt;&lt;/p&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>A link for group text</title><link>http://www.intersoftsolutions.com/Community/WebGrid/A-link-for-group-text/</link><pubDate>Tue, 29 Mar 2011 03:21:44 GMT</pubDate><dc:creator>qq397472251</dc:creator><description>&lt;p&gt;&lt;span class="postusername"&gt;&amp;nbsp;Hi,&lt;a class="contentlink" href="http://www.intersoftpt.com/Community/Users/yudi/"&gt;Yudi &lt;/a&gt;,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="postusername"&gt;Can you explain why it must use step one("&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;Set the column type of “Country” column to “Custom”&lt;/span&gt;)?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="postusername"&gt;I just use step two,it&amp;nbsp;seems work fine.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="postusername"&gt;&lt;/span&gt; &lt;/p&gt;</description></item><item><title>A link for group text</title><link>http://www.intersoftsolutions.com/Community/WebGrid/A-link-for-group-text/</link><pubDate>Mon, 28 Mar 2011 00:51:00 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;Please carefully follow the steps below.&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;Set the column type of “Country” column to “Custom”&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;pre&gt;&amp;lt;ISWebGrid:WebGridColumn Caption="Country" DataMember="Country" Name="Country" Width="100px"
    ColumnType="Custom"&amp;gt;
&amp;lt;/ISWebGrid:WebGridColumn&amp;gt;&lt;/pre&gt;&lt;li&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Utilize the OnInitializeRow server-side event of WebGrid as shown in the sample snippet code below.&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;pre&gt;protected void WebGrid1_InitializeRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e)
{
    string str = null;

    if (e.Row.Type == RowType.GroupHeader)
    {
        if (e.Row.Cells[0].Text == "UK")
        {
            str = e.Row.Cells[0].Text;
            e.Row.Cells[0].Value = "&amp;lt;a href='http://maps.google.co.uk'" &amp;#43;
            "target='_blank'&amp;gt;" &amp;#43; str &amp;#43; "&amp;lt;/a&amp;gt;";
        }
        if (e.Row.Cells[0].Text == "USA")
        {
            str = e.Row.Cells[0].Text;
            e.Row.Cells[0].Text = "&amp;lt;a href='http://maps.google.com'" &amp;#43;
            "target='_blank'&amp;gt;" &amp;#43; str &amp;#43; "&amp;lt;/a&amp;gt;";
        }
    }
}&lt;/pre&gt;&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;The snippet code will do exactly the same as the “SetLink” JavaScript function in my previous post.&lt;/span&gt;&lt;/p&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;&lt;/a /&gt;&lt;/ol&gt;</description></item><item><title>A link for group text</title><link>http://www.intersoftsolutions.com/Community/WebGrid/A-link-for-group-text/</link><pubDate>Fri, 25 Mar 2011 11:41:31 GMT</pubDate><dc:creator>dwh168</dc:creator><description>&lt;p&gt;Thank you for your reply.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;But we can not do this on Client side  due to security reason. We need to encrypt some values in the URL.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;David&lt;br /&gt;&lt;/p&gt;</description></item><item><title>A link for group text</title><link>http://www.intersoftsolutions.com/Community/WebGrid/A-link-for-group-text/</link><pubDate>Tue, 22 Mar 2011 23:21:34 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;Currently, there is no property that handles your requirement, adding anchor – &amp;lt;a …&amp;gt; tag – to the group header of WebGrid.&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 scenario can be achieved through client-side (JavaScript) script by accessing the cell element of group header and set its innerHTML property with the desired value, in this case is adding the anchor tag.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;I create a simple sample of WebGrid. The grid is bind to Employees table of Northwind.mdb and grouped by Country and Title field.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;...
    &lt;span style="font-family: 'consolas', 'courier new'; color: blue; font-size: 9pt"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; color: #a31515; font-size: 9pt"&gt;RootTable&lt;/span&gt; &lt;span style="font-family: 'consolas', 'courier new'; color: red; font-size: 9pt"&gt;DataKeyField&lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; color: blue; font-size: 9pt"&gt;="EmployeeID"&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; color: #a31515; font-size: 9pt"&gt;GroupedColumns&lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; color: blue; font-size: 9pt"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; color: #a31515; font-size: 9pt"&gt;ISWebGrid&lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; color: blue; font-size: 9pt"&gt;:&lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; color: #a31515; font-size: 9pt"&gt;WebGridGroup&lt;/span&gt; &lt;span style="font-family: 'consolas', 'courier new'; color: red; font-size: 9pt"&gt;ColumnMember&lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; color: blue; font-size: 9pt"&gt;="Country"&lt;/span&gt; &lt;span style="font-family: 'consolas', 'courier new'; color: red; font-size: 9pt"&gt;GroupMode&lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; color: blue; font-size: 9pt"&gt;="Expanded" /&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; color: #a31515; font-size: 9pt"&gt;ISWebGrid&lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; color: blue; font-size: 9pt"&gt;:&lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; color: #a31515; font-size: 9pt"&gt;WebGridGroup&lt;/span&gt; &lt;span style="font-family: 'consolas', 'courier new'; color: red; font-size: 9pt"&gt;ColumnMember&lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; color: blue; font-size: 9pt"&gt;="Title"&lt;/span&gt; &lt;span style="font-family: 'consolas', 'courier new'; color: red; font-size: 9pt"&gt;GroupMode&lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; color: blue; font-size: 9pt"&gt;="Expanded" /&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; color: #a31515; font-size: 9pt"&gt;GroupedColumns&lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; color: blue; font-size: 9pt"&gt;&amp;gt;&lt;/span&gt;
    ...&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;A script that is used to set a link on the root group header is added into the page.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&lt;span style="font-family: 'consolas', 'courier new'; color: blue; font-size: 9pt"&gt;function&lt;/span&gt; &lt;span style="font-family: 'consolas', 'courier new'; font-size: 9pt"&gt;SetLink() {&lt;/span&gt;
    &lt;span style="font-family: 'consolas', 'courier new'; color: green; font-size: 9pt"&gt;// get WebGrid's object&lt;/span&gt;
    &lt;span style="font-family: 'consolas', 'courier new'; color: blue; font-size: 9pt"&gt;var&lt;/span&gt; &lt;span style="font-family: 'consolas', 'courier new'; font-size: 9pt"&gt;WebGrid1 = ISGetObject(&lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; color: #a31515; font-size: 9pt"&gt;"WebGrid1"&lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; font-size: 9pt"&gt;);&lt;/span&gt;

    &lt;span style="font-family: 'consolas', 'courier new'; color: green; font-size: 9pt"&gt;// get the RootTable object of WebGrid&lt;/span&gt;
    &lt;span style="font-family: 'consolas', 'courier new'; color: blue; font-size: 9pt"&gt;var&lt;/span&gt; &lt;span style="font-family: 'consolas', 'courier new'; font-size: 9pt"&gt;table = WebGrid1.GetRootTable();&lt;/span&gt;

    &lt;span style="font-family: 'consolas', 'courier new'; color: green; font-size: 9pt"&gt;// obtains the collection of the GroupRows&lt;/span&gt;
    &lt;span style="font-family: 'consolas', 'courier new'; color: blue; font-size: 9pt"&gt;var&lt;/span&gt; &lt;span style="font-family: 'consolas', 'courier new'; font-size: 9pt"&gt;groupRows = table.GetGroupRows();&lt;/span&gt;

    &lt;span style="font-family: 'consolas', 'courier new'; color: green; font-size: 9pt"&gt;// iterate through groupRows&lt;/span&gt;
    &lt;span style="font-family: 'consolas', 'courier new'; color: blue; font-size: 9pt"&gt;for&lt;/span&gt; &lt;span style="font-family: 'consolas', 'courier new'; font-size: 9pt"&gt;(&lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; color: blue; font-size: 9pt"&gt;var&lt;/span&gt; &lt;span style="font-family: 'consolas', 'courier new'; font-size: 9pt"&gt;i = 0; i &amp;lt; groupRows.length; i&amp;#43;&amp;#43;) {&lt;/span&gt;
        &lt;span style="font-family: 'consolas', 'courier new'; color: blue; font-size: 9pt"&gt;if&lt;/span&gt; &lt;span style="font-family: 'consolas', 'courier new'; font-size: 9pt"&gt;(groupRows[i].GroupRowText == &lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; color: #a31515; font-size: 9pt"&gt;"UK"&lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; font-size: 9pt"&gt;)
            groupRows[i].GetElement().childNodes[1].innerHTML = &lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; color: #a31515; font-size: 9pt"&gt;"&amp;lt;a href='&lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; color: blue; font-size: 9pt"&gt;http://maps.google.co.uk&lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; color: #a31515; font-size: 9pt"&gt;'"&lt;/span&gt; &lt;span style="font-family: 'consolas', 'courier new'; font-size: 9pt"&gt;&amp;#43;&lt;/span&gt;
                &lt;span style="font-family: 'consolas', 'courier new'; color: #a31515; font-size: 9pt"&gt;"target='_blank'&amp;gt;"&lt;/span&gt; &lt;span style="font-family: 'consolas', 'courier new'; font-size: 9pt"&gt;&amp;#43; groupRows[i].GroupRowText &amp;#43; &lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; color: #a31515; font-size: 9pt"&gt;"&amp;lt;/a&amp;gt;"&lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; font-size: 9pt"&gt;;&lt;/span&gt;
        &lt;span style="font-family: 'consolas', 'courier new'; color: blue; font-size: 9pt"&gt;if&lt;/span&gt; &lt;span style="font-family: 'consolas', 'courier new'; font-size: 9pt"&gt;(groupRows[i].GroupRowText == &lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; color: #a31515; font-size: 9pt"&gt;"USA"&lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; font-size: 9pt"&gt;)
            groupRows[i].GetElement().childNodes[1].innerHTML = &lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; color: #a31515; font-size: 9pt"&gt;"&amp;lt;a href='&lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; color: blue; font-size: 9pt"&gt;http://maps.google.com&lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; color: #a31515; font-size: 9pt"&gt;'"&lt;/span&gt; &lt;span style="font-family: 'consolas', 'courier new'; font-size: 9pt"&gt;&amp;#43;&lt;/span&gt;
                &lt;span style="font-family: 'consolas', 'courier new'; color: #a31515; font-size: 9pt"&gt;"target='_blank'&amp;gt;"&lt;/span&gt; &lt;span style="font-family: 'consolas', 'courier new'; font-size: 9pt"&gt;&amp;#43; groupRows[i].GroupRowText &amp;#43; &lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; color: #a31515; font-size: 9pt"&gt;"&amp;lt;/a&amp;gt;"&lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; font-size: 9pt"&gt;;
    }&lt;/span&gt;

    &lt;span style="font-family: 'consolas', 'courier new'; color: blue; font-size: 9pt"&gt;return true&lt;/span&gt;&lt;span style="font-family: 'consolas', 'courier new'; font-size: 9pt"&gt;;
}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;If the GroupRowText equals to “UK” then add a link to UK google maps and so does if the GroupRowText equals to “USA”.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;I enclosed the sample as attachment. Please download and test the sample on your end and let us know whether it helps or not.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>A link for group text</title><link>http://www.intersoftsolutions.com/Community/WebGrid/A-link-for-group-text/</link><pubDate>Tue, 22 Mar 2011 13:51:14 GMT</pubDate><dc:creator>dwh168</dc:creator><description>&lt;p&gt;I am not sure, is it possible to add &amp;lt;a&amp;gt; link to the group header.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;For example, (see the picture) to add link to "MY TEST".&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;David&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>