﻿<?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 - Make image button in a cell of each row visible based on some logic. </title><link>http://www.intersoftsolutions.com/Community/WebGrid/Make-image-button-in-a-cell-of-each-row-visible-based-on-some-logic/</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>Make image button in a cell of each row visible based on some logic. </title><link>http://www.intersoftsolutions.com/Community/WebGrid/Make-image-button-in-a-cell-of-each-row-visible-based-on-some-logic/</link><pubDate>Mon, 05 Mar 2012 21:45:33 GMT</pubDate><dc:creator>gstroud012</dc:creator><description>&lt;p&gt;Thanks!&lt;/p&gt;</description></item><item><title>Make image button in a cell of each row visible based on some logic. </title><link>http://www.intersoftsolutions.com/Community/WebGrid/Make-image-button-in-a-cell-of-each-row-visible-based-on-some-logic/</link><pubDate>Mon, 27 Feb 2012 22:49:55 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;blockquote&gt;&lt;p&gt;Which server side event on the webgrid do I used to control visibility of an image button...&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;Thank you for your recent inquiry about how to control visibility of ButtonImage ColumnType 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;Due to popular demand, WebGrid now includes a new ButtonImage column type for handy button display with image. Although developers can use Template column type to specify any kind of contents such as &amp;lt;asp:Image&amp;gt;, it doesn't take advantage of WebGrid's postback mechanism and developers have to handle the events manually, which is time consuming.&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 following screenshot shows a WebGrid using ButtonImage column type in the first column.&lt;/span&gt;&lt;/p&gt;&lt;img width="387" height="212" src="http://www.intersoftpt.com/Community/Attachments/3126/ButtonImageColumnType.png" /&gt; 
&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;The sample ButtonImage definition in WebGridColumn is as following:&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&amp;lt;ISWebGrid:WebGridColumn Name="btnInfo" ColumnType="ButtonImage"
    Width="30px" ButtonImage="images/info.gif" ButtonAutoPostback="true"&amp;gt;
&amp;lt;/ISWebGrid:WebGridColumn&amp;gt;&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;About how to use ButtonImage column type and assign the image of the button, please find the related article in the WebGrid’s documentation. NewButtonImageColumnType.aspx sample file in WebGrid Samples project (start &amp;gt; All Programs &amp;gt; Intersoft WebUI Studio 2011 R2 SP1 &amp;gt; WebUI Studio for ASP.NET &amp;gt; WebGrid 7 &amp;gt; C# or VB Samples) or check the live sample version in &lt;a href="http://live.intersoftpt.com/cs/WebGrid/NewButtonImageColumnType.aspx?noframe=1"&gt;here&lt;/a&gt;, can be used for your reference.&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’d like to suggest you to utilize the InitializeRow server side event of WebGrid in order to control visibility of an image button. The snippet code below shows how to set the image button to be invisible if row’s key value is equals to 2 (this code can be tested on NewButtonImageColumnType.aspx sample file).&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;protected void WebGrid1_InitializeRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e)
{
    ...

    if ((int)e.Row.KeyValue == 2)
    {
        e.Row.Cells.GetNamedItem("btnInfo").CustomObjectAttributes = "style='display:none'";
    }
}&lt;/pre&gt;&lt;img width="402" height="243" src="http://www.intersoftpt.com/Community/Attachments/3126/ButtonImageIsNotVisible.png" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;p&gt;... Also can you direct me to documention that describes each server side event on the webgrid? ...&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;The step by step below will guide you to obtain the documentation which describes each server side event on 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;Open WebGrid 7 Documentation (start &amp;gt; All Programs &amp;gt; Intersoft WebUI Studio 2011 R2 SP1 &amp;gt; WebGrid 7 &amp;gt; WebGrid 7 Documentation.&lt;/li&gt;&lt;li&gt;In the Content page (the left side pane), navigate to Help Viewer Home &amp;gt; WebGrid &amp;gt; Server-side references &amp;gt; ISNet.WebUI.WebGrid Assembly &amp;gt; ISNet.WebUI.WebGrid Namespace &amp;gt; WebGrid Class &amp;gt; WebGrid Class Events.&lt;/li&gt;&lt;/ol&gt;&lt;img width="397" height="223" src="http://www.intersoftpt.com/Community/Attachments/3126/WebGridDocumentation.png" /&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>Make image button in a cell of each row visible based on some logic. </title><link>http://www.intersoftsolutions.com/Community/WebGrid/Make-image-button-in-a-cell-of-each-row-visible-based-on-some-logic/</link><pubDate>Mon, 20 Feb 2012 22:45:04 GMT</pubDate><dc:creator>gstroud012</dc:creator><description>&lt;p&gt;Which server side event on  the webgrid do I used to control visibility of an image button.  Also can you direct me to documention that describes each server side event on the webgrid?&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Greg&lt;/p&gt;</description></item></channel></rss>