views:

1427

answers:

2

Hi. I have tow diferent implementations for the same problem.

A gridview that is binded with some data and it has a select column that has a button. When the button click is fired I know in debug that the : sender.SelectedDataKey and sender.SelectedIndex have values that I use later.

But now I whant to use the ajax accordion control. I have an Accordion, and one Pane inside. Inside that pane I have a CollapsiblePanel (that uses the CollapsiblePanelExtender). And in that CollapsiblePanel I have my Gridview. So, only when I click on the collapsiblePanel I want to get data from DB and bind it to the GridView. But it seems that using this methot the sender.SelectedDataKey and sender.SelectedIndex are Nothing (VB) when the PageIndexChanging fires! This does not make any sense!

The GridView is the some on both implementations and EnableViewState=true

Thank you.

A: 

be sure that your controls are in the same UpdatePanel, or update the various container UpdatePanels.

pomarc
good sugestion, but I'm not using any UpdatePanes explicitly.Ony acoordion panes and Collapsable panels. Any other ideias?but thanks anyway
Txugo
+1  A: 

With the Accordion Panel being an Ajax control, it might be adding the Update Panel in there even though you did not add one to the page. Since the GridView is inside of an Ajax control, all the events that are being triggered by the GridView are going to be captured by Ajax. You might try making the GridView button clicks an Ajax callback as well.

I have run into this problem before where the controls inside of an Ajax Update Panel or an Ajax control; such as the Accordion Panel, fire the server side event handler, but because Ajax is involved, the values were stuck back on the client side.

Joe.Ingalls
I had something like this happen to me as well. I was populating a field in an ajax update panel through ajax, but if I went to read it, I would get the original value instead of what was showing up client side.
Matt Andreko