Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
270
Template Column Web Image Button CommandArgument
posted

I was searching through the old forums trying to figure out how to bind a value to a Templated Column that is using an Web Image Button. For the most part, I saw unanswered posts from a long time ago. I finally found the answer, so I will post it:

This is what the column code looks like for the grid in the aspx page: 

<igtbl:TemplatedColumn Key="RecId" BaseColumnName="RecId" AllowRowFiltering="false" Width="25px">

<CellTemplate>

<igtxt:WebImageButton ID="btnLink" runat="server"

CssClass="pointer"

OnCommand="btnLink_Command" CommandArgument="<%# Container.Value%>" ToolTip="Edit Security">

<Appearance>

<Image Url="~/Image/icon/ico_edit.gif" />

</Appearance>

</igtxt:WebImageButton>

</CellTemplate>

</igtbl:TemplatedColumn>

 

Here is the code behind button command event:

protected void btnLink_Command(object sender, CommandEventArgs e)

{

string i = e.CommandArgument.ToString();

}

 I do have one other question though, is it possible to send the data for more than one column or the entire row using the code above?