Wednesday, March 21, 2012

A problom about updatepanel

If I put a gridview into the panel, the gridview's paging and sorting become useless.

Why? Is there a good point to instead ?

useless? what exactly are you asking? is something not working?
Hi,
It is not a problem about the update panel. You have to write a code for it.
For example:
<cc1:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:GridViewID="GridView1" runat="server" Style="z-index: 102; ">
</asp:GridView>
</ContentTemplate>
<Triggers>
<cc1:ControlEventTrigger ControlID="GridView1"EventName="PageIndexChanging" />
</Triggers>
</cc1:UpdatePanel
Bind a datagrid with a suitable data in page behind code.
Add a code in code behind like this.
Protected Sub GridView1_PageIndexChanging(ByValsender As Object, ByVal e AsSystem.Web.UI.WebControls.GridViewPageEventArgs) HandlesGridView1.PageIndexChanging
GridView1.PageIndex = e.NewPageIndex
End Sub
You wil get it work.
Enjoy programming.
Smile
Hi,
Make sure another thing ..
Check that EnablePartialRendering=true property in script manager.
If you didnt add this property to script manager everything works as usual with postback.
Regards,
Enjoy programming,
Muthu Kumaran.D
(Unknown is Ocean)
This is incorrect. If the gridview is inside the update panel, why do you need the trigger? I've set mine up normally (with full postbacks), then added 4 lines, open and close <atlas:UpdatePanel> and <ContentTemplate> and that was all it took.
hi rchern13,
I agree that I am wrong. But I should inform you that this method also working correctly.

No comments:

Post a Comment