Hi,
I have a SPDatasource and a SPGridView in an item edit form. I want to add a button inside the form to click to refresh the SPGridView. Can anyone suggest how to achieve that? Thanks.
<asp:Button runat="server" Text="Button" id="Button1" ></asp:Button> <asp:UpdatePanel ID="UpdatePanel1" runat="server" EnableViewState="TRUE"> <ContentTemplate> <SharePoint:SPGridView runat="server" ID="GridView1" EnableViewState="true" AutoGenerateColumns="False" BorderWidth="0px" CellPadding="1" BorderStyle="None" DataSourceID="spdatasource1"><AlternatingRowStyle CssClass="ms-alternating" /> <HeaderStyle Wrap="False" BackColor="Black" Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False" /> <Columns> <SharePoint:SPboundfield DataField="Created" HeaderText="Event Log Date" SortExpression="Created" /> <SharePoint:SPboundfield DataField="Author" HeaderText="Created By" SortExpression="Author" /> <SharePoint:SPboundfield DataField="Desciption" HeaderText="Event Log Description" SortExpression="Desciption" /> </Columns> <SelectedRowStyle CssClass="ms-selectednav" Font-Bold="True" /></SharePoint:SPGridView> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" /> </Triggers> </asp:UpdatePanel>
- Edited by karen0123456789 Friday, November 01, 2013 3:01 AM Added code block