|
Template col w/Command and img path
I’ve got a quick question concerning Some Rather Tricky work in the Microsoft Datagrid.
Ive got a templated column – that will display one of two paths (i.e.: Images/myGif.gif) depending on a sql statement.
Its based on a Boolean field so it will be a zero or a one and switch – gifs accordingly. This works great
However, my boss has requested that I add a Command to this Template such as [OnItemCommand="GetMyCondition"]
, so you can click on the actual Image and have it post back to the server and Change the 0 to 1 or 1 to 0 and display the image accordingly.
I do have another button column that does this just fine but, he wants it to be that column itself which fires the command and makes the switch.
Ive told him that as far as I know this isn’t possible and hopefully someone will know that.
Rik
<asp:TemplateColumn HeaderText="Enabled">
<ItemTemplate>
<asp:image Runat="server" ImageUrl='<%# DataBinder.Eval(Container.DataItem, "EnabledImg") %>'></asp:image>
</ItemTemplate>
</asp:TemplateColumn>
|