in

CodeSmith Community

Your Code. Your Way. Faster!

EntityGridView losing GridViewSearchPanel state?

Last post 04-23-2007 9:22 AM by david849. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 04-20-2007 3:49 PM

    • david849
    • Top 500 Contributor
    • Joined on 03-13-2007
    • Posts 12
    • Points 275

    EntityGridView losing GridViewSearchPanel state?

    I have a EntityGridView with an associated GridViewSearchPanel.  In the EntityGridView are several columns, one of which is a template field


        <asp:TemplateField HeaderStyle-Width="17px">
            <ItemTemplate>
                <asp:ImageButton ID="imgAcc" runat="server" CommandName="AddAcc" CausesValidation="false" imageUrl="../Images/16-cube-green.png" tooltip="Add" />
            </ItemTemplate>
            <ItemStyle Width="10px" HorizontalAlign="Center" VerticalAlign="Middle"/>
            <CONTROLSTYLE WIDTH="17" BORDERWIDTH="0" BORDERSTYLE="inset" />
        </asp:TemplateField>

     Everything works great in the EntityGridView before I do a search.  When I do a search using the GridViewSearchPanel it filters the results like it should and everything works great.....until i click on the imageButton.  The imageButton then executes a server-side method and when the page refreshes the EntityGridView is now showing the original unfiltered results...the EntityGridView still shows the user's search string.

     I thought this might be something with the code that executes on click on my ImageButton, so I removed everything from the method and it still happens.

    Also, on another page, i am using a ButtonField (see below) and the same thing happens.

        <asp:buttonfield buttontype="image" commandname="add" imageUrl="../Images/16-cube-blue.png" >
            <CONTROLSTYLE WIDTH="17" BORDERWIDTH="0" BORDERSTYLE="inset" />
        </asp:buttonfield>

     

    Also, I am putting the HandleGridViewSearchPanelState in the Page_Init on my pages for all of my GridViewSearchPanels.

        protected void Page_Init ( object sender, EventArgs e )
        {
            FormUtil.HandleGridViewSearchPanelState ( gvspDWM );
        }

    Any ideas? 

    Thanks,

    David
     

    • Post Points: 35
  • 04-22-2007 2:44 PM In reply to

    • mike123
    • Top 10 Contributor
    • Joined on 02-25-2005
    • Toronto, Ontario
    • Posts 723
    • Points 16,775

    Re: EntityGridView losing GridViewSearchPanel state?

    Answer

    David,

    When clicking imageButton try also executing gvspDWM.DataBind();

     

    Mike Shatny
    -------------------------------------
    Member of the .netTiers team
    http://www.nettiers.com
    -------------------------------------
    • Post Points: 35
  • 04-23-2007 9:22 AM In reply to

    • david849
    • Top 500 Contributor
    • Joined on 03-13-2007
    • Posts 12
    • Points 275

    Re: EntityGridView losing GridViewSearchPanel state?

    Thanks Mike!  That worked!!!
    • Post Points: 5
Page 1 of 1 (3 items)
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems