Popupcontrol extender in a datalist or gridview

Last post 02-23-2007 1:47 AM by Fredrik N. 1 replies.

Sort Posts:

  • Popupcontrol extender in a datalist or gridview

    02-23-2007, 1:29 AM
    • Member
      5 point Member
    • musclejj
    • Member since 12-10-2006, 10:14 AM
    • Posts 10

    Hi all,

    I have a datalist and on clicking a link button i would like a popupcontrol to appear.

    With the selection in the popupcontrol, i would then update the datalistitem in the datalist.

    However, i have a problem finding the index of the datalist that called the popup.

    Hopefully someone can help me.

     

  • Re: Popupcontrol extender in a datalist or gridview

    02-23-2007, 1:47 AM
    • All-Star
      29,644 point All-Star
    • Fredrik N
    • Member since 06-22-2002, 1:03 AM
    • Sweden
    • Posts 5,334
    • TrustedFriends-MVPs

    Don't know if the following solution will work for you, but want to share how I did something similar. 

     

    I recently did something similar but used the DropDown control from the ASP.Net Ajax Toolkit. What I did was to create user control and added a property to the control that will hold the id “key” of the row in my GridView (I didn’t use a DataList, but the similar solution can be used). I then bind the field that has the “id” from my data-source to the control’s property. When I select an option from my DropDown (The ASP.Net Ajax DropDown control will popup a specified Panel with some LinkButtons for the options), I could get the id of the current row and use it to modify the data. In your case you could bind the RowIndex or also a “key”.

     

    Note: In my solution I didn’t want to use the RowCommand event because the DropDown will display a Panel where I have LinkButtons, and I wanted to use the click event of the LinkButton to perform different actions etc.

    /Fredrik Normén - fredrikn @ twitter

    ASPInsider

    Microsoft MVP, MCSD, MCAD, MCT

    ASPInsiders
    My Blog
Page 1 of 1 (2 items)