Note that there are some explanatory texts on larger screens.

plurals
  1. PORefresh of GridView after UpdateMethod in UpdatePanel
    primarykey
    data
    text
    <p>I have setup a GridView inside an UpdatePanel. The GridView has a SELECT CommandField that is tied to Gridview1_SelectedIndexChanged method. I would like the GridView to refresh after a row is selected but it never does. I have tried several different scenarios and none seem to work. </p> <ul> <li>I have set UpdateMode to "Conditional" and "Always" on the UpdatePanel and tried to force an update to the UpdatePanel in the code behind.</li> <li>I have converted the CommandField to a templatefield with a button</li> </ul> <p>Here is the sanitized code:</p> <pre><code> &lt;asp:UpdatePanel ID="UpdatePanel1" runat="server"&gt; &lt;ContentTemplate&gt; &lt;asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="ObjectDataSource1" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" PagerSettings-Visible="true" EnableViewState="False" &gt; &lt;Columns&gt; &lt;asp:CommandField ButtonType="Image" SelectImageUrl="~/images/icon.gif" ShowSelectButton="True" /&gt; &lt;asp:BoundField DataField="Id" HeaderText="Id" SortExpression="Id" /&gt; &lt;asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" /&gt; &lt;/Columns&gt; &lt;/asp:GridView&gt; &lt;/ContentTemplate&gt; &lt;Triggers&gt; &lt;asp:AsyncPostBackTrigger ControlID="GridView1" EventName="SelectedIndexChanged" /&gt; &lt;/Triggers&gt; &lt;/asp:UpdatePanel&gt; </code></pre> <p>The data source looks something like this...</p> <pre><code>&lt;asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DataObjectTypeName="myNamespace.Item" InsertMethod="myInsertMethod" SelectMethod="mySelectMethod" TypeName="myNamespace.ItemMgr" UpdateMethod="myUpdateMethod"&gt; &lt;/asp:ObjectDataSource&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload