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:
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????????????
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?
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.
c0pe
Member
319 Points
435 Posts
updatePanel question - selectedIndexChanged of gridview doesn't fire unless
Feb 25, 2012 07:22 PM|LINK
Hello,
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"> <Triggers> <asp:PostBackTrigger ControlID="GridView_Clients" /> <asp:PostBackTrigger ControlID="btnSave_NewOrEdit_Client" /> </Triggers>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
waelouf
Member
250 Points
41 Posts
Re: updatePanel question - selectedIndexChanged of gridview doesn't fire unless
Feb 26, 2012 09:00 AM|LINK
Try this:
c0pe
Member
319 Points
435 Posts
Re: updatePanel question - selectedIndexChanged of gridview doesn't fire unless
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?
c0pe
Member
319 Points
435 Posts
Re: updatePanel question - selectedIndexChanged of gridview doesn't fire unless
Feb 26, 2012 06:38 PM|LINK
actually,
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.