How to prevent the select button in the grid view from delaying to respond RRS feed

  • Question

  • User2143564534 posted

    The select button from the grid view delays to respond when clicked, is there a way to prevent this

    Thank you

    Thursday, January 11, 2018 8:55 AM

All replies

  • User541108374 posted


    The select button from the grid view delays to respond when clicked

    What do you mean by this? When you click the button it takes ... seconds before something happens? Is this the GridView control of WebForms or the one of WebPages (as you originally put your question in that particular forum).


    Thursday, January 11, 2018 9:20 AM
  • User2143564534 posted

    yes it takes seconds before it displays the information required, webforms.

    i am sorry i was not specific/clear in my question.

    <asp:GridView ID="gvProductResults" runat="server"
    AutoGenerateColumns="False" CellPadding="4" DataKeyNames="ProductID"
    onselectedindexchanged="gvProductResults_SelectedIndexChanged" GridLines="None"
    <EditRowStyle BackColor="#999999" />
    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" HorizontalAlign="Left" />
    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" HorizontalAlign="Left"/>
    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />

    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
    <asp:BoundField DataField="ProductName" HeaderText="Product Name" SortExpression="Product Name" />
    <asp:BoundField DataField="ProductType" HeaderText="Product Category" SortExpression="Product Category" />
    <asp:BoundField DataField="ProductSubType" HeaderText="Product Sub Category" SortExpression="Product Sub Category" />

    <asp:ButtonField ButtonType="Button" CommandName="Select" Text="Select" HeaderText="Action" />
    <SortedAscendingCellStyle BackColor="#E9E7E2" />
    <SortedAscendingHeaderStyle BackColor="#506C8C" />
    <SortedDescendingCellStyle BackColor="#FFFDF8" />
    <SortedDescendingHeaderStyle BackColor="#6F8DAE" />

    Thursday, January 11, 2018 9:41 AM
  • User541108374 posted


    it's causing a full postback so the page is being sent to the server, all of the Page Life Cycle is done, data gathered from a database, ... and then the result is sent back to the browser.

    If you debug you can see where the most lengthy parts are wasted. Try to optimize those. Also take a look into the select query. Don't do select * from but rather take only the columns you need.

    For one of my former projects we left the GridView path and went for a custom jqGrid solution in combination with webservices. Took way more time to implement but gave faster results.


    Thursday, January 11, 2018 10:00 AM
  • User2143564534 posted

    Thank you so much let me try that.

    Thursday, January 11, 2018 10:13 AM