ModalPopUpExtender from Nested Gridview buttons

Last post 08-06-2009 11:26 PM by steemin77. 2 replies.

Sort Posts:

  • ModalPopUpExtender from Nested Gridview buttons

    07-31-2009, 1:54 PM
    • Member
      5 point Member
    • steemin77
    • Member since 07-12-2009, 4:02 PM
    • Posts 8

    Hello,

    I am working on a project in which I have a gridview with several nested child gridviews. For each child gridview, I have several add buttons which will use the Ajax ModalPopUpExtender to bring up a panel popup. Depending on which add linkbutton is clicked, it will change the appearance of the popup and bring it up for the user to enter the data. After the user enters the data, they click OK and the new row of data is added to the database table and shown in the childgrid (I haven't gotten this far yet) OR the user hits cancel and goes back to the page as if the click never occured.

    The approach I was taking was to assign a ModalPopupControl for each linkbutton for each childgrid. This seemed to work fine when I was testing in Firefox. However, when I did the same in Internet Explorer, I received a warning "a script on this page is causing Internet Explorer to run slowly". I assume this is because I have about 100 childgrids with 5 buttons each assigned to a ModalPopupControl.

    One solution was to reduce the 5 'Add' buttons down to 1 and have the user select the different options instead of customizing the popup panel based on the type of button clicked. However, there may be particular days when the number of gridview entries is long enough to trigger the same warning within IE even if there is only 1 'Add' button. Hence, I would prefer a more elegant solution to accomodate this situation.

    I was thinking I could just have a single ModalPopUpControl somewhere within my aspx or a separate control file. Then use the Onclick eventhandlers from the Add Linkbuttons within the childgrids to activate the PopUp and customize the Panel based on which button fired the onclick event. However, if this is the best approach, I am confused on how I would implement it. Is there a way to simply enable/disable the popup control from the code behind using the Onclick events? Note that I would also like to pass certain values from the child gridview that fired the event into and out of popup control. Can anyone tell me if this is a practical solution and how I could get started?

    Thanks -

  • Re: ModalPopUpExtender from Nested Gridview buttons

    08-02-2009, 2:49 AM

    Your explaination is long and takes a lot of concentration to follow...

    but...

    if the final result of the "YES/NO" popup is always the same wouldnt it be a lot easier to always call the same popup and pass in variables to a Label to display <whatever> the user is saying "Yes/NO" To?

    example -> OnButtonPressFromGridview()

    {

    Label1.Text = "Ask Question.... Are you Happy?"

    Button1.Txt="Yes"

    }

    LATER IN THE CODE. enable all the PopUpBUttonCode....

    PopUPButtonCode_Yes()

    {

    Do.Something = DOITNOW;

    Do.Something.Else = DO.THAT.NOT;

    }

    and

    PopUPButtonCode_NO()

    {

    this.closePanel;

    }

    i get the distinct impression that your popup is more for visual effect than anything else... as such, it should be handled as its own "page" (so to say).


    I am not sure exactly why you are using the YES/NO... and if it's actually a "YES/NO" response.... if "YES" = <RUN SOME COMMAND/METHOD" and "NO" = Cancel then the same panel/popup could be used to control many different "YES/NO" responses by assigning different variables/methods to the panel.


    i hope this works.

    I've asked a lot of "theory" questions on this forum and few people answer in any method useful (if at all) i hope this helps. (mark answered if so).






  • Re: ModalPopUpExtender from Nested Gridview buttons

    08-06-2009, 11:26 PM
    Answer
    • Member
      5 point Member
    • steemin77
    • Member since 07-12-2009, 4:02 PM
    • Posts 8

    Hello,

    I got this partly working using javascript. The user has to input a dollar amount and select an account number. However, I want pass value out of the sending child gridview footer and assign this value to a label in the modalpopup. I have been searching for this for a couple days but have been unable to solve this.

    I tried btn.attributes.add("onclick", "javascript:addvalue('" + value + "')"); on the rowdatabound event handler for the childgrid. However, it doesn't seem to do anything.

Page 1 of 1 (3 items)