﻿<?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 - WebGird IntializeRow Template Control Properties not availble in Post Back</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGird-IntializeRow-Template-Control-Properties-not-availble-in-Post-Back/</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>WebGird IntializeRow Template Control Properties not availble in Post Back</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGird-IntializeRow-Template-Control-Properties-not-availble-in-Post-Back/</link><pubDate>Tue, 03 Aug 2010 11:15:01 GMT</pubDate><dc:creator>DJBadin</dc:creator><description>&lt;p&gt;Thanks,  that did it.&lt;/p&gt;
&lt;p&gt;Doug&lt;/p&gt;</description></item><item><title>WebGird IntializeRow Template Control Properties not availble in Post Back</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGird-IntializeRow-Template-Control-Properties-not-availble-in-Post-Back/</link><pubDate>Tue, 03 Aug 2010 00:06:12 GMT</pubDate><dc:creator>Glayaar</dc:creator><description>&lt;p&gt;Based on my discussion with the developer, setting the value during the InitializeRow server side event will be too late. You will need to assign the CommandName and CommandArgument earlier in the life cycle. Our suggestion will be to assigned it in the designer using the bind keyword. Here is the snippet:&lt;/p&gt;&lt;pre&gt;&amp;lt;ISWebGrid:WebGridColumn Name="View_WebGridColumn" Bound="false" EditType="NoEdit"&lt;br /&gt;    ColumnType="Template" Caption=" " Width="50px"&amp;gt;&lt;br /&gt;    &amp;lt;CellStyle ForeColor="Black" /&amp;gt;&lt;br /&gt;    &amp;lt;CellTemplate&amp;gt;&lt;br /&gt;        &amp;lt;asp:LinkButton ID="PDF_LinkButton" runat="server" OnCommand="Command_Button_Click" &lt;br /&gt;            CommandName="QuoteView" CommandArgument='&amp;lt;%# Bind("CALLNUM1") %&amp;gt;'/&amp;gt;&lt;br /&gt;    &amp;lt;/CellTemplate&amp;gt;&lt;br /&gt;&amp;lt;/ISWebGrid:WebGridColumn&amp;gt;&lt;/pre&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>WebGird IntializeRow Template Control Properties not availble in Post Back</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGird-IntializeRow-Template-Control-Properties-not-availble-in-Post-Back/</link><pubDate>Mon, 02 Aug 2010 19:20:45 GMT</pubDate><dc:creator>DJBadin</dc:creator><description>&lt;p&gt;I am using a ColumnType of "Template" for a asp:LinkButton&lt;/p&gt;&lt;pre&gt;&amp;lt;ISWebGrid:WebGridColumn
	Name="View_WebGridColumn"
	Bound="false"
	EditType="NoEdit"
	ColumnType="Template"
	Caption=" "
	Width="50px"
&amp;gt;
	&amp;lt;CellStyle ForeColor="Black" /&amp;gt;
	&amp;lt;CellTemplate&amp;gt;
		&amp;lt;asp:LinkButton
			ID="PDF_LinkButton"
			runat="server"
			OnCommand="Command_Button_Click"
		/&amp;gt;
	&amp;lt;/CellTemplate&amp;gt;
&amp;lt;/ISWebGrid:WebGridColumn&amp;gt;
&lt;/pre&gt;

&lt;p&gt;In the WebGrid IntializeRow Server Side Event I set the following for the LinkButton&lt;/p&gt;
&lt;p&gt;- Visible&lt;br /&gt;- CommandArgument&lt;br /&gt;- CommandName&lt;br /&gt;- Text&lt;br /&gt;- ToolTip&lt;/p&gt;&lt;pre&gt;protected void _WebGrid_InitializeRow(object sender, RowEventArgs e)
{
	if (e.Row.Type == RowType.Record)
	{
		WebGridCellCollection _WebGridCellCollection = e.Row.Cells;

		DataRowView _DataRow = e.Row.DataRow as DataRowView;

		Int32 CallNumber_Int32 = Convert.ToInt32(_DataRow["CALLNUM1"].ToString());
		String AgentCode_String = AgentCode_TextBox.Text;

		LinkButton PDF_LinkButton = (LinkButton) e.Row.Cells[1].GetTemplateContainer().FindControl("PDF_LinkButton");

		PDF_LinkButton.Visible = false;

		PDF_LinkButton.CommandArgument = CallNumber_Int32.ToString();
		PDF_LinkButton.CommandName = "QuoteView";

		PDF_LinkButton.Text = "View";
		PDF_LinkButton.ToolTip = "View Assessment";

		// PDF

		String FileFormat_String = "";
		String FileName_String = "";
		String FilePath_String = "";

		FileFormat_String = Common.ServiceQuoteFileType(); //Desired format goes here (PDF, Excel, or Image)
			FileName_String = Common.ServiceQuoteFileName(AgentCode_String, Convert.ToInt32(CallNumber_Int32));
		FilePath_String = Common.ServiceQuoteFilePath(FileName_String);

		if (File.Exists(FilePath_String))
		{
			PDF_LinkButton.Visible = true;
		}

	}
}
&lt;/pre&gt;


&lt;p&gt; &lt;/p&gt;
&lt;p&gt;The Page renders OK.&lt;/p&gt;
&lt;p&gt;However, when I click on the Link Button, the Command_Button_Click Server-Side Event shows the CommandArgument and CommandName being empty.&lt;/p&gt;&lt;pre&gt;protected void Command_Button_Click(Object sender, CommandEventArgs e)
{

	switch (e.CommandName)
	{
		case "QuoteView":

...
			break;
	}

}

&lt;/pre&gt;

&lt;p&gt;What am I doing wrong?&lt;/p&gt;
&lt;p&gt;How can I access the the CommandArgument and CommandName set in _WebGrid_InitializeRow in the Command_Button_Click Server Side Event?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Doug&lt;/p&gt;</description></item></channel></rss>