Item Command ,Strange issue

O

ozaro

Hi ,

I have a very strange issue , i have a datagrid where i have 2
itemTemplate
where an image button resides in one item template and an <A> tag
(Html)on another
as follows

Start Example :

<asp:TemplateColumn>
<HeaderStyle HorizontalAlign="Right" Width="5%"></HeaderStyle>
<ItemStyle HorizontalAlign="Right"></ItemStyle>
<ItemTemplate>
<A href="javascript:OpenPopUp('PopUpBlank.aspx?
uc=./UI/Shoppers/ListAllShoppers&StoreID=<%#
DataBinder.Eval(Container, "DataItem.StoreID") %>&StoreName=<%#
DataBinder.Eval(Container, "DataItem.StoreName") %>&StoreLatitude=<%#
DataBinder.Eval(Container, "DataItem.LocationLatitude")
%>&StoreLongitude=<%# DataBinder.Eval(Container,
"DataItem.LocationLongitude")%>&mission=allocate')"><img
src="images/allocate.gif" alt="Allocate" border=0></A>
</ItemTemplate>
<FooterStyle HorizontalAlign="Right"></FooterStyle>
</asp:TemplateColumn>
<asp:TemplateColumn>
<HeaderStyle HorizontalAlign="Right" Width="5%"></HeaderStyle>
<ItemStyle HorizontalAlign="Right"></ItemStyle>
<ItemTemplate>
<asp:ImageButton ImageUrl="../../images/unallocate.gif"
ID="Unallocate" AlternateText="Unallocate" CommandName="Unallocate"
CommandArgument='<%# DataBinder.Eval(Container, "DataItem.StoreID")
%>' Runat=server >
</asp:ImageButton>
</ItemTemplate>
<FooterStyle HorizontalAlign="Right"></FooterStyle>
</asp:TemplateColumn>

End Example


The story so far:
what happens is that when the <a> is clicked it pop up a window and a
list of persons appeaars , the users selects one from the pop up and
the pop up close and refresh the parent window

If i used the image button that has an "Unallocate" command Name , it
will fire the item command and it removes the person (who has just
been selected from the pop up )till here there is no problem , the
problem is that when i click the <a> again it gets the pop up window
and then the user selects the person , Then it refreshes the parent
window ,But the Unallocate button fires again and Unallocates(removes)
the selected person and so it doesn't show in the grid ,nevertheless
i fill the datagrid again

Item Created events is as follows
-------------------------------------
if(e.CommandName.ToString() == "Unallocate")
{
ProjectsBiz objProjectBiz = new ProjectsBiz();
objProjectBiz.UnAllocateRatingSheetsToShoppers(System.DBNull.Value,
int.Parse(e.CommandArgument.ToString()));
}
FillDataGrid();
-------------------------------------
Please help , if am not clear engouh i would be glad to clarify it
more
Thanks in advace
your quick response will be highly appreciated
ozaro
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top