Item Command ,Strange issue

Discussion in 'ASP .Net Datagrid Control' started by ozaro, Jan 28, 2004.

  1. ozaro

    ozaro Guest

    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
    ozaro, Jan 28, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ssoss

    Display Related Item or Add Item

    ssoss, Sep 17, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    484
    ssoss
    Sep 19, 2003
  2. Replies:
    2
    Views:
    615
  3. root

    item[LENGTH] vs. *item and malloc()

    root, Aug 21, 2003, in forum: C Programming
    Replies:
    2
    Views:
    386
    Eric Sosman
    Aug 21, 2003
  4. Steven Bethard
    Replies:
    0
    Views:
    393
    Steven Bethard
    Mar 12, 2005
  5. George Shawn
    Replies:
    4
    Views:
    172
    George Shawn
    Jan 17, 2007
Loading...

Share This Page