user2502256
user2502256

Reputation: 11

how to click button load gridview but disload page web

I have a problem with ASPxGridView. I have a aspxgridview1 contain button. aspxgridview2 contain data. when I pressed the button. data will be displayed on the aspgridview2 corresponding "ID" of aspxgridview1 but without reloading the page. this is following aspxgridview1

<dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" KeyFieldName="Province_Id">
            <Columns>
                <dx:GridViewCommandColumn VisibleIndex="0">
                    <EditButton Visible="True">
                    </EditButton>
                    <ClearFilterButton Visible="True">
                    </ClearFilterButton>
                    <CustomButtons>
                        <dx:GridViewCommandColumnCustomButton ID="show" Text="show">
                        </dx:GridViewCommandColumnCustomButton>
                    </CustomButtons>
                </dx:GridViewCommandColumn>
                <dx:GridViewDataTextColumn FieldName="Province_Id" ReadOnly="True" VisibleIndex="1">
                    <EditFormSettings Visible="False" />
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="Name" VisibleIndex="2">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataButtonEditColumn VisibleIndex="4">
                </dx:GridViewDataButtonEditColumn>
            </Columns>
            <SettingsBehavior AllowFocusedRow="True" />
            <Settings ShowFilterRow="True" ShowFooter="True" ShowGroupPanel="True" ShowTitlePanel="True" />
        </dx:ASPxGridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TravelConnectionString %>" DeleteCommand="DELETE FROM [Province] WHERE [Province_Id] = @Province_Id" InsertCommand="INSERT INTO [Province] ([Name]) VALUES (@Name)" SelectCommand="SELECT * FROM [Province]" UpdateCommand="UPDATE [Province] SET [Name] = @Name WHERE [Province_Id] = @Province_Id">
            <DeleteParameters>
                <asp:Parameter Name="Province_Id" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="Name" Type="String" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="Name" Type="String" />
                <asp:Parameter Name="Province_Id" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>

Upvotes: 0

Views: 635

Answers (1)

Jason P
Jason P

Reputation: 27022

If you're set on using the ASPxGridViews, the best you can do is wrap both controls in UpdatePanels. If you don't like that solution, you'll need to look into using ajax to get the data after clicking a button.

Upvotes: 1

Related Questions