Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 26, 2012 06:38 PM by c0pe
Feb 25, 2012 07:22 PM|LINK
I have a gridview inside an updatePanel. The updatemode is conditional and childrenAsTriggers is set to true on the updatePanel. The gridview has sorting enabled, and the delete and selected buttons (in a commandField).
The sorting works, the delete button works, however the select button will not work unless I explicitly set the gridview as a trigger in the updatePanel. This confuses me greatly. Why does the ChrildrenAsTriggers not take care of making all controls within
the updatePanel able to cause postback and update the content of the updatePanel????
Heres the beginning of the updatePanel definition:
<asp:UpdatePanel ID="upForClientsGridview" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
<asp:PostBackTrigger ControlID="GridView_Clients" />
<asp:PostBackTrigger ControlID="btnSave_NewOrEdit_Client" />
The btnSave_NewOrEdit_Client trigger is there because that button is in a a different updatePanel used to make a modal form which is used to create/edit records work properly. Basically, I needed an updatePanel to make the modalPopupExtender work like it
should, not I'm having to put other things in updatePanels as a side effect.
Hopefully not diverting your attention from this bottom line: the gridview inside an update panel has a commandField with delete and select buttons. The delete button works fine but the select button will not postback (selectedIndexChanged of gridview does
not fire) unless I define the gridview as a postback trigger as shown in code example above????????????
someone please save my sanity
Feb 26, 2012 09:00 AM|LINK
<asp:AsyncPostBackTrigger ControlID="GridView_Clients" EventName="selectedIndexChanged"/>
Feb 26, 2012 01:56 PM|LINK
thanks for the reply waelouf, however I'm looking for an answer to my specific question... I've already make the select button work by adding a postback trigger, my question is why do I need to do that? the delete button works without needed a trigger defined?
the sorting works without needing a trigger defined?
Feb 26, 2012 06:38 PM|LINK
waelouf, that was it, but where it should go specifically was the key for me... my mistake was to define that trigger in the updatePanel that the gridview was in... where it needed to go was in the updatePanel that actually contained controls where I will
be displaying the details of the selected row of the gridview... essentially, needed to tell the updatePanel that hold the details, that is should update when the selectedIndexChanged event files from the gridview which is in a different updatePanel. I basically
just had it backwards.
it works now.
I need to move forward and get stuff done, but one thing in general that I'm not happy with is that my pages are doing a lot of 'flickering'... so I'm sure I still have something set not quite right. I'll need to figure that out and then go back and fix
a bunch of pages.
thanks for th input all.